mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 21:09:11 +00:00
* fix: correct HTTP error handling in gateway * refactor: migrate database and ORM to internal modules * feat: introduce taskfile build system for improved workflow management * refactor: update taskfiles to use relative paths * feat: add profile status field * refactor: move rendering logic to context package * fix: improve error handling in credentials retrieval * refactor: optimize HTTP request handling in Wasm environment * refactor: refactor config loading in motr command * chore: add process-compose for service management * chore: remove default task and update gum format command * fix: update project dependencies * refactor: improve code readability and maintainability * refactor: consolidate error handling components * refactor: update index handler to use new context package * refactor: consolidate database scripts and move to deploy directory * feat: Update flake.nix with development tools and environment configuration * fix: ignore flake.lock file * refactor: migrate build process to use taskfiles for improved modularity and maintainability * refactor: improve GatewayContext and reorganize handlers * refactor: Remove unused profile creation functions * (chore): templ generation * test: add test file for vaults.go * maintenance: remove defunct Discord server link * docs: update checks workflow documentation * test: remove obsolete vaults test file * refactor: move version bumping logic to release workflow
112 lines
2.2 KiB
Go
112 lines
2.2 KiB
Go
// Code generated from Pkl module `sonr.net.Hway`. DO NOT EDIT.
|
|
package hway
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/apple/pkl-go/pkl"
|
|
)
|
|
|
|
type Hway interface {
|
|
GetServePort() int
|
|
|
|
GetSqliteFile() string
|
|
|
|
GetChainId() string
|
|
|
|
GetIpfsGatewayUrl() string
|
|
|
|
GetSonrApiUrl() string
|
|
|
|
GetSonrGrpcUrl() string
|
|
|
|
GetSonrRpcUrl() string
|
|
|
|
GetPsqlDSN() string
|
|
|
|
GetTurnstileSiteKey() string
|
|
}
|
|
|
|
var _ Hway = (*HwayImpl)(nil)
|
|
|
|
type HwayImpl struct {
|
|
ServePort int `pkl:"servePort"`
|
|
|
|
SqliteFile string `pkl:"sqliteFile"`
|
|
|
|
ChainId string `pkl:"chainId"`
|
|
|
|
IpfsGatewayUrl string `pkl:"ipfsGatewayUrl"`
|
|
|
|
SonrApiUrl string `pkl:"sonrApiUrl"`
|
|
|
|
SonrGrpcUrl string `pkl:"sonrGrpcUrl"`
|
|
|
|
SonrRpcUrl string `pkl:"sonrRpcUrl"`
|
|
|
|
PsqlDSN string `pkl:"psqlDSN"`
|
|
|
|
TurnstileSiteKey string `pkl:"turnstileSiteKey"`
|
|
}
|
|
|
|
func (rcv *HwayImpl) GetServePort() int {
|
|
return rcv.ServePort
|
|
}
|
|
|
|
func (rcv *HwayImpl) GetSqliteFile() string {
|
|
return rcv.SqliteFile
|
|
}
|
|
|
|
func (rcv *HwayImpl) GetChainId() string {
|
|
return rcv.ChainId
|
|
}
|
|
|
|
func (rcv *HwayImpl) GetIpfsGatewayUrl() string {
|
|
return rcv.IpfsGatewayUrl
|
|
}
|
|
|
|
func (rcv *HwayImpl) GetSonrApiUrl() string {
|
|
return rcv.SonrApiUrl
|
|
}
|
|
|
|
func (rcv *HwayImpl) GetSonrGrpcUrl() string {
|
|
return rcv.SonrGrpcUrl
|
|
}
|
|
|
|
func (rcv *HwayImpl) GetSonrRpcUrl() string {
|
|
return rcv.SonrRpcUrl
|
|
}
|
|
|
|
func (rcv *HwayImpl) GetPsqlDSN() string {
|
|
return rcv.PsqlDSN
|
|
}
|
|
|
|
func (rcv *HwayImpl) GetTurnstileSiteKey() string {
|
|
return rcv.TurnstileSiteKey
|
|
}
|
|
|
|
// LoadFromPath loads the pkl module at the given path and evaluates it into a Hway
|
|
func LoadFromPath(ctx context.Context, path string) (ret Hway, err error) {
|
|
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
defer func() {
|
|
cerr := evaluator.Close()
|
|
if err == nil {
|
|
err = cerr
|
|
}
|
|
}()
|
|
ret, err = Load(ctx, evaluator, pkl.FileSource(path))
|
|
return ret, err
|
|
}
|
|
|
|
// 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) (Hway, error) {
|
|
var ret HwayImpl
|
|
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
|
return nil, err
|
|
}
|
|
return &ret, nil
|
|
}
|