mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 13:07:09 +00:00
refactor: migrate to new configuration system and model definitions
This commit is contained in:
parent
40f50bf37a
commit
0502f52ec0
14
Makefile
14
Makefile
@ -308,15 +308,13 @@ sh-testnet: mod-tidy
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
.PHONY: gen-pkl gen-templ
|
.PHONY: gen-pkl gen-templ
|
||||||
|
|
||||||
gen-pkl:
|
gen-pkl: init-env
|
||||||
go install github.com/apple/pkl-go/cmd/pkl-gen-go@latest
|
pkl-gen-go pkl/sonr.orm/UCAN.pkl
|
||||||
pkl-gen-go pkl/sonr.motr/ATN.pkl
|
pkl-gen-go pkl/sonr.orm/Models.pkl
|
||||||
pkl-gen-go pkl/sonr.hway/Env.pkl
|
pkl-gen-go pkl/sonr.conf/Hway.pkl
|
||||||
pkl-gen-go pkl/sonr.motr/DWN.pkl
|
pkl-gen-go pkl/sonr.conf/Motr.pkl
|
||||||
pkl-gen-go pkl/sonr.hway/ORM.pkl
|
|
||||||
|
|
||||||
gen-templ:
|
gen-templ: init-env
|
||||||
@go install github.com/a-h/templ/cmd/templ@latest
|
|
||||||
templ generate
|
templ generate
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@ import (
|
|||||||
"github.com/labstack/echo/v4/middleware"
|
"github.com/labstack/echo/v4/middleware"
|
||||||
"github.com/onsonr/sonr/crypto/ucan"
|
"github.com/onsonr/sonr/crypto/ucan"
|
||||||
"github.com/onsonr/sonr/internal/gateway"
|
"github.com/onsonr/sonr/internal/gateway"
|
||||||
"github.com/onsonr/sonr/internal/gateway/config"
|
|
||||||
"github.com/onsonr/sonr/pkg/common/ipfs"
|
"github.com/onsonr/sonr/pkg/common/ipfs"
|
||||||
|
config "github.com/onsonr/sonr/pkg/config/hway"
|
||||||
"github.com/onsonr/sonr/pkg/database/sessions"
|
"github.com/onsonr/sonr/pkg/database/sessions"
|
||||||
"github.com/onsonr/sonr/pkg/didauth/producer"
|
"github.com/onsonr/sonr/pkg/didauth/producer"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -60,13 +60,13 @@ func rootCmd() *cobra.Command {
|
|||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadEnvImplFromArgs(args []string) (config.Env, error) {
|
func loadEnvImplFromArgs(args []string) (config.Hway, error) {
|
||||||
cmd := rootCmd()
|
cmd := rootCmd()
|
||||||
if err := cmd.ParseFlags(args); err != nil {
|
if err := cmd.ParseFlags(args); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
env := &config.EnvImpl{
|
env := &config.HwayImpl{
|
||||||
ServePort: servePort,
|
ServePort: servePort,
|
||||||
ConfigDir: configDir,
|
ConfigDir: configDir,
|
||||||
SqliteFile: sqliteFile,
|
SqliteFile: sqliteFile,
|
||||||
@ -80,7 +80,7 @@ func loadEnvImplFromArgs(args []string) (config.Env, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// setupServer sets up the server
|
// setupServer sets up the server
|
||||||
func setupServer(env config.Env) (*echo.Echo, error) {
|
func setupServer(env config.Hway) (*echo.Echo, error) {
|
||||||
ipc, err := ipfs.NewClient()
|
ipc, err := ipfs.NewClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ATN`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT.
|
||||||
package attns
|
package attns
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -7,11 +7,11 @@ import (
|
|||||||
"github.com/apple/pkl-go/pkl"
|
"github.com/apple/pkl-go/pkl"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ATN struct {
|
type UCAN struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadFromPath loads the pkl module at the given path and evaluates it into a ATN
|
// LoadFromPath loads the pkl module at the given path and evaluates it into a UCAN
|
||||||
func LoadFromPath(ctx context.Context, path string) (ret *ATN, err error) {
|
func LoadFromPath(ctx context.Context, path string) (ret *UCAN, err error) {
|
||||||
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -26,9 +26,9 @@ func LoadFromPath(ctx context.Context, path string) (ret *ATN, err error) {
|
|||||||
return ret, err
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a ATN
|
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a UCAN
|
||||||
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*ATN, error) {
|
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*UCAN, error) {
|
||||||
var ret ATN
|
var ret UCAN
|
||||||
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ATN`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT.
|
||||||
package capability
|
package capability
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ATN`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT.
|
||||||
package attns
|
package attns
|
||||||
|
|
||||||
import "github.com/apple/pkl-go/pkl"
|
import "github.com/apple/pkl-go/pkl"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
pkl.RegisterMapping("sonr.motr.ATN", ATN{})
|
pkl.RegisterMapping("sonr.orm.UCAN", UCAN{})
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ATN`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT.
|
||||||
package policytype
|
package policytype
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ATN`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT.
|
||||||
package resourcetype
|
package resourcetype
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
// Code generated from Pkl module `sonr.hway.Env`. DO NOT EDIT.
|
|
||||||
package config
|
|
||||||
|
|
||||||
import "github.com/apple/pkl-go/pkl"
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
pkl.RegisterMapping("sonr.hway.Env", EnvImpl{})
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.DWN`. DO NOT EDIT.
|
|
||||||
package config
|
|
||||||
|
|
||||||
import "github.com/apple/pkl-go/pkl"
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
pkl.RegisterMapping("sonr.motr.DWN", DWN{})
|
|
||||||
pkl.RegisterMapping("sonr.motr.DWN#Config", Config{})
|
|
||||||
pkl.RegisterMapping("sonr.motr.DWN#Schema", Schema{})
|
|
||||||
pkl.RegisterMapping("sonr.motr.DWN#Environment", Environment{})
|
|
||||||
}
|
|
@ -5,8 +5,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
|
config "github.com/onsonr/sonr/pkg/config/motr"
|
||||||
|
|
||||||
"github.com/onsonr/sonr/internal/vault/types"
|
|
||||||
"github.com/onsonr/sonr/pkg/common"
|
"github.com/onsonr/sonr/pkg/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ func Get(c echo.Context) (SessionCtx, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WebNodeMiddleware establishes a Session Cookie.
|
// WebNodeMiddleware establishes a Session Cookie.
|
||||||
func Middleware(config *types.Config) echo.MiddlewareFunc {
|
func Middleware(config *config.Config) echo.MiddlewareFunc {
|
||||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||||
return func(c echo.Context) error {
|
return func(c echo.Context) error {
|
||||||
err := injectConfig(c, config)
|
err := injectConfig(c, config)
|
||||||
@ -46,7 +46,7 @@ func Middleware(config *types.Config) echo.MiddlewareFunc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func injectConfig(c echo.Context, config *types.Config) error {
|
func injectConfig(c echo.Context, config *config.Config) error {
|
||||||
common.HeaderWrite(c, common.SonrAPIURL, config.SonrApiUrl)
|
common.HeaderWrite(c, common.SonrAPIURL, config.SonrApiUrl)
|
||||||
common.HeaderWrite(c, common.SonrRPCURL, config.SonrRpcUrl)
|
common.HeaderWrite(c, common.SonrRPCURL, config.SonrRpcUrl)
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package config
|
package embed
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/ipfs/boxo/files"
|
"github.com/ipfs/boxo/files"
|
||||||
"github.com/onsonr/sonr/internal/vault/embed"
|
config "github.com/onsonr/sonr/pkg/config/motr"
|
||||||
)
|
)
|
||||||
|
|
||||||
const SchemaVersion = 1
|
const SchemaVersion = 1
|
||||||
@ -17,7 +17,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// spawnVaultDirectory creates a new directory with the default files
|
// spawnVaultDirectory creates a new directory with the default files
|
||||||
func NewVaultFS(cfg *Config) (files.Directory, error) {
|
func NewVaultFS(cfg *config.Config) (files.Directory, error) {
|
||||||
manifestBz, err := newWebManifestBytes()
|
manifestBz, err := newWebManifestBytes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -29,15 +29,15 @@ func NewVaultFS(cfg *Config) (files.Directory, error) {
|
|||||||
return files.NewMapDirectory(map[string]files.Node{
|
return files.NewMapDirectory(map[string]files.Node{
|
||||||
AppManifestFileName: files.NewBytesFile(manifestBz),
|
AppManifestFileName: files.NewBytesFile(manifestBz),
|
||||||
DWNConfigFileName: files.NewBytesFile(cnfBz),
|
DWNConfigFileName: files.NewBytesFile(cnfBz),
|
||||||
IndexHTMLFileName: files.NewBytesFile(embed.IndexHTML),
|
IndexHTMLFileName: files.NewBytesFile(IndexHTML),
|
||||||
MainJSFileName: files.NewBytesFile(embed.MainJS),
|
MainJSFileName: files.NewBytesFile(MainJS),
|
||||||
ServiceWorkerFileName: files.NewBytesFile(embed.WorkerJS),
|
ServiceWorkerFileName: files.NewBytesFile(WorkerJS),
|
||||||
}), nil
|
}), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewVaultConfig returns the default vault config
|
// NewVaultConfig returns the default vault config
|
||||||
func NewVaultConfig(addr string, ucanCID string) *Config {
|
func NewVaultConfig(addr string, ucanCID string) *config.Config {
|
||||||
return &Config{
|
return &config.Config{
|
||||||
MotrToken: ucanCID,
|
MotrToken: ucanCID,
|
||||||
MotrAddress: addr,
|
MotrAddress: addr,
|
||||||
IpfsGatewayUrl: "http://localhost:80",
|
IpfsGatewayUrl: "http://localhost:80",
|
@ -1,4 +1,4 @@
|
|||||||
package config
|
package embed
|
||||||
|
|
||||||
import "encoding/json"
|
import "encoding/json"
|
||||||
|
|
@ -1,15 +1,16 @@
|
|||||||
package config
|
package embed
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/onsonr/sonr/pkg/common/models"
|
"github.com/onsonr/sonr/pkg/common/models"
|
||||||
|
config "github.com/onsonr/sonr/pkg/config/motr"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultSchema returns the default schema
|
// DefaultSchema returns the default schema
|
||||||
func DefaultSchema() *Schema {
|
func DefaultSchema() *config.Schema {
|
||||||
return &Schema{
|
return &config.Schema{
|
||||||
Version: SchemaVersion,
|
Version: SchemaVersion,
|
||||||
Account: getSchema(&models.Account{}),
|
Account: getSchema(&models.Account{}),
|
||||||
Asset: getSchema(&models.Asset{}),
|
Asset: getSchema(&models.Asset{}),
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package models
|
package models
|
||||||
|
|
||||||
type Account struct {
|
type Account struct {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package models
|
package models
|
||||||
|
|
||||||
type Asset struct {
|
type Asset struct {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package models
|
package models
|
||||||
|
|
||||||
type Chain struct {
|
type Chain struct {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package models
|
package models
|
||||||
|
|
||||||
type Credential struct {
|
type Credential struct {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package models
|
package models
|
||||||
|
|
||||||
type Grant struct {
|
type Grant struct {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package models
|
package models
|
||||||
|
|
||||||
type JWK struct {
|
type JWK struct {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package models
|
package models
|
||||||
|
|
||||||
type Keyshare struct {
|
type Keyshare struct {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -7,14 +7,14 @@ import (
|
|||||||
"github.com/apple/pkl-go/pkl"
|
"github.com/apple/pkl-go/pkl"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ORM struct {
|
type Models struct {
|
||||||
DbName string `pkl:"db_name"`
|
DbName string `pkl:"db_name"`
|
||||||
|
|
||||||
DbVersion int `pkl:"db_version"`
|
DbVersion int `pkl:"db_version"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadFromPath loads the pkl module at the given path and evaluates it into a ORM
|
// LoadFromPath loads the pkl module at the given path and evaluates it into a Models
|
||||||
func LoadFromPath(ctx context.Context, path string) (ret *ORM, err error) {
|
func LoadFromPath(ctx context.Context, path string) (ret *Models, err error) {
|
||||||
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -29,9 +29,9 @@ func LoadFromPath(ctx context.Context, path string) (ret *ORM, err error) {
|
|||||||
return ret, err
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a ORM
|
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Models
|
||||||
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*ORM, error) {
|
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Models, error) {
|
||||||
var ret ORM
|
var ret Models
|
||||||
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package models
|
package models
|
||||||
|
|
||||||
type Profile struct {
|
type Profile struct {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package assettype
|
package assettype
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package didmethod
|
package didmethod
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package models
|
package models
|
||||||
|
|
||||||
import "github.com/apple/pkl-go/pkl"
|
import "github.com/apple/pkl-go/pkl"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
pkl.RegisterMapping("sonr.motr.ORM", ORM{})
|
pkl.RegisterMapping("sonr.orm.Models", Models{})
|
||||||
pkl.RegisterMapping("sonr.motr.ORM#Account", Account{})
|
pkl.RegisterMapping("sonr.orm.Models#Account", Account{})
|
||||||
pkl.RegisterMapping("sonr.motr.ORM#Asset", Asset{})
|
pkl.RegisterMapping("sonr.orm.Models#Asset", Asset{})
|
||||||
pkl.RegisterMapping("sonr.motr.ORM#Chain", Chain{})
|
pkl.RegisterMapping("sonr.orm.Models#Chain", Chain{})
|
||||||
pkl.RegisterMapping("sonr.motr.ORM#Credential", Credential{})
|
pkl.RegisterMapping("sonr.orm.Models#Credential", Credential{})
|
||||||
pkl.RegisterMapping("sonr.motr.ORM#DID", DID{})
|
pkl.RegisterMapping("sonr.orm.Models#DID", DID{})
|
||||||
pkl.RegisterMapping("sonr.motr.ORM#JWK", JWK{})
|
pkl.RegisterMapping("sonr.orm.Models#JWK", JWK{})
|
||||||
pkl.RegisterMapping("sonr.motr.ORM#Grant", Grant{})
|
pkl.RegisterMapping("sonr.orm.Models#Grant", Grant{})
|
||||||
pkl.RegisterMapping("sonr.motr.ORM#Keyshare", Keyshare{})
|
pkl.RegisterMapping("sonr.orm.Models#Keyshare", Keyshare{})
|
||||||
pkl.RegisterMapping("sonr.motr.ORM#Profile", Profile{})
|
pkl.RegisterMapping("sonr.orm.Models#Profile", Profile{})
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package keyalgorithm
|
package keyalgorithm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package keycurve
|
package keycurve
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package keyencoding
|
package keyencoding
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package keyrole
|
package keyrole
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package keysharerole
|
package keysharerole
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package keytype
|
package keytype
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package permissiongrant
|
package permissiongrant
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.ORM`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.orm.Models`. DO NOT EDIT.
|
||||||
package permissionscope
|
package permissionscope
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -4,16 +4,17 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/apple/pkl-go/pkl"
|
"github.com/apple/pkl-go/pkl"
|
||||||
|
hwayconfig "github.com/onsonr/sonr/pkg/config/hway"
|
||||||
)
|
)
|
||||||
|
|
||||||
// LoadFromBytes loads the environment from the given bytes
|
// LoadFromBytes loads the environment from the given bytes
|
||||||
func LoadFromBytes(data []byte) (Env, error) {
|
func LoadHwayFromBytes(data []byte) (hwayconfig.Hway, error) {
|
||||||
text := string(data)
|
text := string(data)
|
||||||
return LoadFromString(text)
|
return LoadHwayFromString(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadFromString loads the environment from the given string
|
// LoadFromString loads the environment from the given string
|
||||||
func LoadFromString(text string) (Env, error) {
|
func LoadHwayFromString(text string) (hwayconfig.Hway, error) {
|
||||||
evaluator, err := pkl.NewEvaluator(context.Background(), pkl.PreconfiguredOptions)
|
evaluator, err := pkl.NewEvaluator(context.Background(), pkl.PreconfiguredOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -24,12 +25,12 @@ func LoadFromString(text string) (Env, error) {
|
|||||||
err = cerr
|
err = cerr
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
ret, err := Load(context.Background(), evaluator, pkl.TextSource(text))
|
ret, err := hwayconfig.Load(context.Background(), evaluator, pkl.TextSource(text))
|
||||||
return ret, err
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadFromURL loads the environment from the given URL
|
// LoadFromURL loads the environment from the given URL
|
||||||
func LoadFromURL(url string) (Env, error) {
|
func LoadFromURL(url string) (hwayconfig.Hway, error) {
|
||||||
evaluator, err := pkl.NewEvaluator(context.Background(), pkl.PreconfiguredOptions)
|
evaluator, err := pkl.NewEvaluator(context.Background(), pkl.PreconfiguredOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -40,6 +41,6 @@ func LoadFromURL(url string) (Env, error) {
|
|||||||
err = cerr
|
err = cerr
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
ret, err := Load(context.Background(), evaluator, pkl.UriSource(url))
|
ret, err := hwayconfig.Load(context.Background(), evaluator, pkl.UriSource(url))
|
||||||
return ret, err
|
return ret, err
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
// Code generated from Pkl module `sonr.hway.Env`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.conf.Hway`. DO NOT EDIT.
|
||||||
package config
|
package hway
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/apple/pkl-go/pkl"
|
"github.com/apple/pkl-go/pkl"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Env interface {
|
type Hway interface {
|
||||||
GetServePort() int
|
GetServePort() int
|
||||||
|
|
||||||
GetConfigDir() string
|
GetConfigDir() string
|
||||||
@ -25,9 +25,9 @@ type Env interface {
|
|||||||
GetSonrRpcUrl() string
|
GetSonrRpcUrl() string
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ Env = (*EnvImpl)(nil)
|
var _ Hway = (*HwayImpl)(nil)
|
||||||
|
|
||||||
type EnvImpl struct {
|
type HwayImpl struct {
|
||||||
ServePort int `pkl:"servePort"`
|
ServePort int `pkl:"servePort"`
|
||||||
|
|
||||||
ConfigDir string `pkl:"configDir"`
|
ConfigDir string `pkl:"configDir"`
|
||||||
@ -45,40 +45,40 @@ type EnvImpl struct {
|
|||||||
SonrRpcUrl string `pkl:"sonrRpcUrl"`
|
SonrRpcUrl string `pkl:"sonrRpcUrl"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rcv *EnvImpl) GetServePort() int {
|
func (rcv *HwayImpl) GetServePort() int {
|
||||||
return rcv.ServePort
|
return rcv.ServePort
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rcv *EnvImpl) GetConfigDir() string {
|
func (rcv *HwayImpl) GetConfigDir() string {
|
||||||
return rcv.ConfigDir
|
return rcv.ConfigDir
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rcv *EnvImpl) GetSqliteFile() string {
|
func (rcv *HwayImpl) GetSqliteFile() string {
|
||||||
return rcv.SqliteFile
|
return rcv.SqliteFile
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rcv *EnvImpl) GetChainId() string {
|
func (rcv *HwayImpl) GetChainId() string {
|
||||||
return rcv.ChainId
|
return rcv.ChainId
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rcv *EnvImpl) GetIpfsGatewayUrl() string {
|
func (rcv *HwayImpl) GetIpfsGatewayUrl() string {
|
||||||
return rcv.IpfsGatewayUrl
|
return rcv.IpfsGatewayUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rcv *EnvImpl) GetSonrApiUrl() string {
|
func (rcv *HwayImpl) GetSonrApiUrl() string {
|
||||||
return rcv.SonrApiUrl
|
return rcv.SonrApiUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rcv *EnvImpl) GetSonrGrpcUrl() string {
|
func (rcv *HwayImpl) GetSonrGrpcUrl() string {
|
||||||
return rcv.SonrGrpcUrl
|
return rcv.SonrGrpcUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rcv *EnvImpl) GetSonrRpcUrl() string {
|
func (rcv *HwayImpl) GetSonrRpcUrl() string {
|
||||||
return rcv.SonrRpcUrl
|
return rcv.SonrRpcUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadFromPath loads the pkl module at the given path and evaluates it into a Env
|
// LoadFromPath loads the pkl module at the given path and evaluates it into a Hway
|
||||||
func LoadFromPath(ctx context.Context, path string) (ret Env, err error) {
|
func LoadFromPath(ctx context.Context, path string) (ret Hway, err error) {
|
||||||
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -93,9 +93,9 @@ func LoadFromPath(ctx context.Context, path string) (ret Env, err error) {
|
|||||||
return ret, err
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Env
|
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Hway
|
||||||
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (Env, error) {
|
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (Hway, error) {
|
||||||
var ret EnvImpl
|
var ret HwayImpl
|
||||||
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
8
pkg/config/hway/init.pkl.go
Normal file
8
pkg/config/hway/init.pkl.go
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// Code generated from Pkl module `sonr.conf.Hway`. DO NOT EDIT.
|
||||||
|
package hway
|
||||||
|
|
||||||
|
import "github.com/apple/pkl-go/pkl"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
pkl.RegisterMapping("sonr.conf.Hway", HwayImpl{})
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.DWN`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.conf.Motr`. DO NOT EDIT.
|
||||||
package config
|
package motr
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
IpfsGatewayUrl string `pkl:"ipfsGatewayUrl" json:"ipfsGatewayUrl,omitempty"`
|
IpfsGatewayUrl string `pkl:"ipfsGatewayUrl" json:"ipfsGatewayUrl,omitempty"`
|
@ -1,5 +1,5 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.DWN`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.conf.Motr`. DO NOT EDIT.
|
||||||
package config
|
package motr
|
||||||
|
|
||||||
type Environment struct {
|
type Environment struct {
|
||||||
IsDevelopment bool `pkl:"isDevelopment" json:"isDevelopment,omitempty"`
|
IsDevelopment bool `pkl:"isDevelopment" json:"isDevelopment,omitempty"`
|
@ -1,5 +1,5 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.DWN`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.conf.Motr`. DO NOT EDIT.
|
||||||
package config
|
package motr
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -7,11 +7,11 @@ import (
|
|||||||
"github.com/apple/pkl-go/pkl"
|
"github.com/apple/pkl-go/pkl"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DWN struct {
|
type Motr struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadFromPath loads the pkl module at the given path and evaluates it into a DWN
|
// LoadFromPath loads the pkl module at the given path and evaluates it into a Motr
|
||||||
func LoadFromPath(ctx context.Context, path string) (ret *DWN, err error) {
|
func LoadFromPath(ctx context.Context, path string) (ret *Motr, err error) {
|
||||||
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -26,9 +26,9 @@ func LoadFromPath(ctx context.Context, path string) (ret *DWN, err error) {
|
|||||||
return ret, err
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a DWN
|
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Motr
|
||||||
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*DWN, error) {
|
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Motr, error) {
|
||||||
var ret DWN
|
var ret Motr
|
||||||
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
// Code generated from Pkl module `sonr.motr.DWN`. DO NOT EDIT.
|
// Code generated from Pkl module `sonr.conf.Motr`. DO NOT EDIT.
|
||||||
package config
|
package motr
|
||||||
|
|
||||||
type Schema struct {
|
type Schema struct {
|
||||||
Version int `pkl:"version"`
|
Version int `pkl:"version"`
|
11
pkg/config/motr/init.pkl.go
Normal file
11
pkg/config/motr/init.pkl.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// Code generated from Pkl module `sonr.conf.Motr`. DO NOT EDIT.
|
||||||
|
package motr
|
||||||
|
|
||||||
|
import "github.com/apple/pkl-go/pkl"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
pkl.RegisterMapping("sonr.conf.Motr", Motr{})
|
||||||
|
pkl.RegisterMapping("sonr.conf.Motr#Config", Config{})
|
||||||
|
pkl.RegisterMapping("sonr.conf.Motr#Schema", Schema{})
|
||||||
|
pkl.RegisterMapping("sonr.conf.Motr#Environment", Environment{})
|
||||||
|
}
|
@ -1,275 +0,0 @@
|
|||||||
module ipfs.net.Config
|
|
||||||
|
|
||||||
API: API
|
|
||||||
|
|
||||||
Addresses: Addresses
|
|
||||||
|
|
||||||
AutoNAT: Dynamic
|
|
||||||
|
|
||||||
Bootstrap: Listing
|
|
||||||
|
|
||||||
DNS: DNS
|
|
||||||
|
|
||||||
Datastore: Datastore
|
|
||||||
|
|
||||||
Discovery: Discovery
|
|
||||||
|
|
||||||
Experimental: Experimental
|
|
||||||
|
|
||||||
Gateway: Gateway
|
|
||||||
|
|
||||||
Identity: Identity
|
|
||||||
|
|
||||||
Internal: Dynamic
|
|
||||||
|
|
||||||
Ipns: Ipns
|
|
||||||
|
|
||||||
Migration: Migration
|
|
||||||
|
|
||||||
Mounts: Mounts
|
|
||||||
|
|
||||||
Peering: Peering
|
|
||||||
|
|
||||||
Pinning: Pinning
|
|
||||||
|
|
||||||
Plugins: Plugins
|
|
||||||
|
|
||||||
Provider: Provider
|
|
||||||
|
|
||||||
Pubsub: Pubsub
|
|
||||||
|
|
||||||
Reprovider: Reprovider
|
|
||||||
|
|
||||||
Routing: Routing
|
|
||||||
|
|
||||||
Swarm: Swarm
|
|
||||||
|
|
||||||
class API {
|
|
||||||
HTTPHeaders: HTTPHeaders
|
|
||||||
}
|
|
||||||
|
|
||||||
class HTTPHeaders {
|
|
||||||
`Access-Control-Allow-Origin`: Listing
|
|
||||||
}
|
|
||||||
|
|
||||||
class Addresses {
|
|
||||||
API: String
|
|
||||||
|
|
||||||
Announce: Listing<Any>
|
|
||||||
|
|
||||||
AppendAnnounce: Listing<Any>
|
|
||||||
|
|
||||||
Gateway: String
|
|
||||||
|
|
||||||
NoAnnounce: Listing<Any>
|
|
||||||
|
|
||||||
Swarm: Listing
|
|
||||||
}
|
|
||||||
|
|
||||||
class DNS {
|
|
||||||
Resolvers: Dynamic
|
|
||||||
}
|
|
||||||
|
|
||||||
class Datastore {
|
|
||||||
BloomFilterSize: Int
|
|
||||||
|
|
||||||
GCPeriod: String
|
|
||||||
|
|
||||||
HashOnRead: Boolean
|
|
||||||
|
|
||||||
Spec: Spec
|
|
||||||
|
|
||||||
StorageGCWatermark: Int
|
|
||||||
|
|
||||||
StorageMax: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class Spec {
|
|
||||||
mounts: Listing
|
|
||||||
|
|
||||||
type: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class MountsItem0 {
|
|
||||||
child: Child
|
|
||||||
|
|
||||||
mountpoint: String
|
|
||||||
|
|
||||||
prefix: String
|
|
||||||
|
|
||||||
type: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class Child {
|
|
||||||
path: String
|
|
||||||
|
|
||||||
shardFunc: String
|
|
||||||
|
|
||||||
sync: Boolean
|
|
||||||
|
|
||||||
type: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class MountsItem1 {
|
|
||||||
child: MountsItem1Child
|
|
||||||
|
|
||||||
mountpoint: String
|
|
||||||
|
|
||||||
prefix: String
|
|
||||||
|
|
||||||
type: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class MountsItem1Child {
|
|
||||||
compression: String
|
|
||||||
|
|
||||||
path: String
|
|
||||||
|
|
||||||
type: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class Discovery {
|
|
||||||
MDNS: MDNS
|
|
||||||
}
|
|
||||||
|
|
||||||
class MDNS {
|
|
||||||
Enabled: Boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
class Experimental {
|
|
||||||
AcceleratedDHTClient: Boolean
|
|
||||||
|
|
||||||
FilestoreEnabled: Boolean
|
|
||||||
|
|
||||||
GraphsyncEnabled: Boolean
|
|
||||||
|
|
||||||
Libp2pStreamMounting: Boolean
|
|
||||||
|
|
||||||
P2pHttpProxy: Boolean
|
|
||||||
|
|
||||||
StrategicProviding: Boolean
|
|
||||||
|
|
||||||
UrlstoreEnabled: Boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
class Gateway {
|
|
||||||
APICommands: Listing<Any>
|
|
||||||
|
|
||||||
HTTPHeaders: GatewayHTTPHeaders
|
|
||||||
|
|
||||||
NoDNSLink: Boolean
|
|
||||||
|
|
||||||
NoFetch: Boolean
|
|
||||||
|
|
||||||
PathPrefixes: Listing<Any>
|
|
||||||
|
|
||||||
PublicGateways: Any
|
|
||||||
|
|
||||||
RootRedirect: String
|
|
||||||
|
|
||||||
Writable: Boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
class GatewayHTTPHeaders {
|
|
||||||
`Access-Control-Allow-Headers`: Listing
|
|
||||||
|
|
||||||
`Access-Control-Allow-Methods`: Listing
|
|
||||||
|
|
||||||
`Access-Control-Allow-Origin`: Listing
|
|
||||||
}
|
|
||||||
|
|
||||||
class Identity {
|
|
||||||
PeerID: String
|
|
||||||
|
|
||||||
PrivKey: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class Ipns {
|
|
||||||
RecordLifetime: String
|
|
||||||
|
|
||||||
RepublishPeriod: String
|
|
||||||
|
|
||||||
ResolveCacheSize: Int
|
|
||||||
}
|
|
||||||
|
|
||||||
class Migration {
|
|
||||||
DownloadSources: Listing<Any>
|
|
||||||
|
|
||||||
Keep: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class Mounts {
|
|
||||||
FuseAllowOther: Boolean
|
|
||||||
|
|
||||||
IPFS: String
|
|
||||||
|
|
||||||
IPNS: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class Peering {
|
|
||||||
Peers: Listing
|
|
||||||
}
|
|
||||||
|
|
||||||
class PeersItem11 {
|
|
||||||
Addrs: Listing
|
|
||||||
|
|
||||||
ID: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class Pinning {
|
|
||||||
RemoteServices: Dynamic
|
|
||||||
}
|
|
||||||
|
|
||||||
class Plugins {
|
|
||||||
Plugins: Any
|
|
||||||
}
|
|
||||||
|
|
||||||
class Provider {
|
|
||||||
Strategy: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class Pubsub {
|
|
||||||
DisableSigning: Boolean
|
|
||||||
|
|
||||||
Router: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class Reprovider {
|
|
||||||
Interval: String
|
|
||||||
|
|
||||||
Strategy: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class Routing {
|
|
||||||
Methods: Any
|
|
||||||
|
|
||||||
Routers: Any
|
|
||||||
|
|
||||||
Type: String
|
|
||||||
}
|
|
||||||
|
|
||||||
class Swarm {
|
|
||||||
AddrFilters: Any
|
|
||||||
|
|
||||||
ConnMgr: Dynamic
|
|
||||||
|
|
||||||
DisableBandwidthMetrics: Boolean
|
|
||||||
|
|
||||||
DisableNatPortMap: Boolean
|
|
||||||
|
|
||||||
RelayClient: Dynamic
|
|
||||||
|
|
||||||
RelayService: Dynamic
|
|
||||||
|
|
||||||
ResourceMgr: Dynamic
|
|
||||||
|
|
||||||
Transports: Transports
|
|
||||||
}
|
|
||||||
|
|
||||||
class Transports {
|
|
||||||
Multiplexers: Dynamic
|
|
||||||
|
|
||||||
Network: Dynamic
|
|
||||||
|
|
||||||
Security: Dynamic
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
|
||||||
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
/// Configuration files for integrating the Matrix service
|
|
||||||
amends "../basePklProject.pkl"
|
|
||||||
|
|
||||||
package {
|
|
||||||
name = "ipfs.net"
|
|
||||||
version = "0.0.4"
|
|
||||||
}
|
|
@ -1,7 +1,7 @@
|
|||||||
@go.Package { name = "github.com/onsonr/sonr/internal/gateway/config" }
|
@go.Package { name = "github.com/onsonr/sonr/pkg/config/hway" }
|
||||||
|
|
||||||
|
|
||||||
open module sonr.hway.Env
|
open module sonr.conf.Hway
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
@go.Package { name = "github.com/onsonr/sonr/internal/vault/config" }
|
@go.Package { name = "github.com/onsonr/sonr/pkg/config/motr" }
|
||||||
|
|
||||||
module sonr.motr.DWN
|
module sonr.conf.Motr
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
||||||
|
|
@ -17,6 +17,6 @@
|
|||||||
amends "../basePklProject.pkl"
|
amends "../basePklProject.pkl"
|
||||||
|
|
||||||
package {
|
package {
|
||||||
name = "sonr.motr"
|
name = "sonr.conf"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
}
|
}
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"schemaVersion": 1,
|
|
||||||
"resolvedDependencies": {}
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
@go.Package { name = "github.com/onsonr/sonr/pkg/common/models" }
|
@go.Package { name = "github.com/onsonr/sonr/pkg/common/models" }
|
||||||
|
|
||||||
module sonr.motr.ORM
|
module sonr.orm.Models
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
||||||
|
|
@ -17,6 +17,6 @@
|
|||||||
amends "../basePklProject.pkl"
|
amends "../basePklProject.pkl"
|
||||||
|
|
||||||
package {
|
package {
|
||||||
name = "sonr.hway"
|
name = "sonr.orm"
|
||||||
version = "0.0.3"
|
version = "0.0.1"
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
@go.Package { name = "github.com/onsonr/sonr/crypto/ucan/attns" }
|
@go.Package { name = "github.com/onsonr/sonr/crypto/ucan/attns" }
|
||||||
|
|
||||||
module sonr.motr.ATN
|
module sonr.orm.UCAN
|
||||||
|
|
||||||
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
||||||
|
|
@ -32,3 +32,15 @@ if [ ! -f "$ROOT_DIR/bin/process-compose" ]; then
|
|||||||
sh -c "$(curl --location https://raw.githubusercontent.com/F1bonacc1/process-compose/main/scripts/get-pc.sh)" -- -d -b $ROOT_DIR/bin
|
sh -c "$(curl --location https://raw.githubusercontent.com/F1bonacc1/process-compose/main/scripts/get-pc.sh)" -- -d -b $ROOT_DIR/bin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if pkl-gen-go is installed to $GOPATH/bin
|
||||||
|
if [ ! -f "$GOPATH/bin/pkl-gen-go" ]; then
|
||||||
|
echo "pkl-gen-go not found. Installing..."
|
||||||
|
go install github.com/apple/pkl-go/cmd/pkl-gen-go@latest
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if templ is installed to $GOPATH/bin
|
||||||
|
if [ ! -f "$GOPATH/bin/templ" ]; then
|
||||||
|
echo "templ not found. Installing..."
|
||||||
|
go install github.com/a-h/templ/cmd/templ@latest
|
||||||
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user