config

package
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2025 License: Apache-2.0, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load[T Validatable]() (T, error)

Types

type API added in v0.0.13

type API struct {
	// The URL of the node to establish an API connection with
	Endpoint string `mapstructure:"endpoint" validate:"required" flag:"node-url"`
}

type Client added in v0.0.13

type Client struct {
	Identity    IdentityConfig    `mapstructure:"identity"`
	API         API               `mapstructure:"api"`
	UCANService UCANServiceConfig `mapstructure:"ucan" toml:"ucan"`
}

func (Client) Validate added in v0.0.13

func (c Client) Validate() error

type EgressTrackerServiceConfig added in v0.0.15

type EgressTrackerServiceConfig struct {
	DID              string `mapstructure:"did" flag:"egress-tracker-service-did" toml:"did,omitempty"`
	URL              string `mapstructure:"url" flag:"egress-tracker-service-url" toml:"url,omitempty"`
	ReceiptsEndpoint string `mapstructure:"receipts_endpoint" flag:"egress-tracker-service-receipts-endpoint" toml:"receipts_endpoint,omitempty"`
	Proof            string `mapstructure:"proof" flag:"egress-tracker-service-proof" toml:"proof,omitempty"`
}

func (*EgressTrackerServiceConfig) ToAppConfig added in v0.0.15

func (*EgressTrackerServiceConfig) Validate added in v0.0.15

func (c *EgressTrackerServiceConfig) Validate() error

type FullServerConfig added in v0.0.13

type FullServerConfig struct {
	Identity    IdentityConfig    `mapstructure:"identity" toml:"identity"`
	Repo        RepoConfig        `mapstructure:"repo" toml:"repo"`
	Server      ServerConfig      `mapstructure:"server" toml:"server"`
	PDPService  PDPServiceConfig  `mapstructure:"pdp" toml:"pdp"`
	UCANService UCANServiceConfig `mapstructure:"ucan" toml:"ucan"`
}

func (FullServerConfig) ToAppConfig added in v0.0.13

func (f FullServerConfig) ToAppConfig() (app.AppConfig, error)

func (FullServerConfig) Validate added in v0.0.13

func (f FullServerConfig) Validate() error

type IdentityConfig added in v0.0.13

type IdentityConfig struct {
	KeyFile string `mapstructure:"key_file" validate:"required" flag:"key-file" toml:"key_file"`
}

func (IdentityConfig) ToAppConfig added in v0.0.13

func (i IdentityConfig) ToAppConfig() (app.IdentityConfig, error)

func (IdentityConfig) Validate added in v0.0.13

func (i IdentityConfig) Validate() error

type IndexingServiceConfig added in v0.0.13

type IndexingServiceConfig struct {
	DID   string `mapstructure:"did" validate:"required" flag:"indexing-service-did" toml:"did,omitempty"`
	URL   string `mapstructure:"url" validate:"required,url" flag:"indexing-service-url" toml:"url,omitempty"`
	Proof string `mapstructure:"proof" flag:"indexing-service-proof" toml:"proof,omitempty"`
}

func (*IndexingServiceConfig) ToAppConfig added in v0.0.13

func (*IndexingServiceConfig) Validate added in v0.0.13

func (s *IndexingServiceConfig) Validate() error

type LocalConfig added in v0.0.13

type LocalConfig struct {
	Repo RepoConfig `mapstructure:"repo"`
}

func (LocalConfig) Validate added in v0.0.13

func (l LocalConfig) Validate() error

type PDPServerConfig added in v0.0.13

type PDPServerConfig struct {
	Identity   IdentityConfig   `mapstructure:"identity"`
	Repo       RepoConfig       `mapstructure:"repo"`
	Server     ServerConfig     `mapstructure:"server"`
	PDPService PDPServiceConfig `mapstructure:"pdp"`
}

func (PDPServerConfig) Validate added in v0.0.13

func (c PDPServerConfig) Validate() error

type PDPServiceConfig added in v0.0.13

type PDPServiceConfig struct {
	OwnerAddress    string `mapstructure:"owner_address" validate:"required" flag:"owner-address" toml:"owner_address"`
	ContractAddress string `mapstructure:"contract_address" validate:"required" flag:"contract-address" toml:"contract_address"`
	LotusEndpoint   string `mapstructure:"lotus_endpoint" validate:"required" flag:"lotus-endpoint" toml:"lotus_endpoint"`
}

func (PDPServiceConfig) ToAppConfig added in v0.0.13

func (p PDPServiceConfig) ToAppConfig() (app.PDPServiceConfig, error)

func (PDPServiceConfig) Validate added in v0.0.13

func (c PDPServiceConfig) Validate() error

type PublisherServiceConfig added in v0.0.13

type PublisherServiceConfig struct {
	AnnounceURLs []string `` /* 130-byte string literal not displayed */
}

func (*PublisherServiceConfig) ToAppConfig added in v0.0.13

func (s *PublisherServiceConfig) ToAppConfig(publicURL url.URL) (app.PublisherServiceConfig, error)

func (*PublisherServiceConfig) Validate added in v0.0.13

func (s *PublisherServiceConfig) Validate() error

type RepoConfig added in v0.0.13

type RepoConfig struct {
	DataDir string `mapstructure:"data_dir" validate:"required" flag:"data-dir" toml:"data_dir"`
	TempDir string `mapstructure:"temp_dir" validate:"required" flag:"temp-dir" toml:"temp_dir"`
}

func (RepoConfig) ToAppConfig added in v0.0.13

func (r RepoConfig) ToAppConfig() (app.StorageConfig, error)

func (RepoConfig) Validate added in v0.0.13

func (r RepoConfig) Validate() error

type ServerConfig added in v0.0.13

type ServerConfig struct {
	Port      uint   `mapstructure:"port" validate:"required,min=1,max=65535" flag:"port" toml:"port"`
	Host      string `mapstructure:"host" validate:"required" flag:"host" toml:"host"`
	PublicURL string `mapstructure:"public_url" validate:"omitempty,url" flag:"public-url" toml:"public_url"`
}

func (ServerConfig) ToAppConfig added in v0.0.13

func (s ServerConfig) ToAppConfig() (app.ServerConfig, error)

func (ServerConfig) Validate added in v0.0.13

func (s ServerConfig) Validate() error

type ServicesConfig added in v0.0.13

type ServicesConfig struct {
	ServicePrincipalMapping map[string]string `mapstructure:"principal_mapping" flag:"service-principal-mapping" toml:"principal_mapping,omitempty"`

	Indexer       IndexingServiceConfig      `mapstructure:"indexer" validate:"required" toml:"indexer,omitempty"`
	EgressTracker EgressTrackerServiceConfig `mapstructure:"etracker" toml:"etracker,omitempty"`
	Upload        UploadServiceConfig        `mapstructure:"upload" validate:"required" toml:"upload,omitempty"`
	Publisher     PublisherServiceConfig     `mapstructure:"publisher" validate:"required" toml:"publisher,omitempty"`
}

func (ServicesConfig) ToAppConfig added in v0.0.13

func (s ServicesConfig) ToAppConfig(publicURL url.URL) (app.ExternalServicesConfig, error)

func (ServicesConfig) Validate added in v0.0.13

func (s ServicesConfig) Validate() error

type UCANServerConfig added in v0.0.13

type UCANServerConfig struct {
	Identity     IdentityConfig    `mapstructure:"identity"`
	Repo         RepoConfig        `mapstructure:"repo"`
	Server       ServerConfig      `mapstructure:"server"`
	UCANService  UCANServiceConfig `mapstructure:"ucan"`
	PDPServerURL string            `mapstructure:"pdp_server_url"`
}

func (UCANServerConfig) Validate added in v0.0.13

func (u UCANServerConfig) Validate() error

type UCANServiceConfig added in v0.0.13

type UCANServiceConfig struct {
	Services   ServicesConfig `mapstructure:"services" toml:"services"`
	ProofSetID uint64         `mapstructure:"proof_set" flag:"proof-set" toml:"proof_set"`
}

func (UCANServiceConfig) ToAppConfig added in v0.0.13

func (s UCANServiceConfig) ToAppConfig(publicURL url.URL) (app.UCANServiceConfig, error)

func (UCANServiceConfig) Validate added in v0.0.13

func (s UCANServiceConfig) Validate() error

type UploadServiceConfig added in v0.0.13

type UploadServiceConfig struct {
	DID string `mapstructure:"did" validate:"required" flag:"upload-service-did" toml:"did,omitempty"`
	URL string `mapstructure:"url" validate:"required,url" flag:"upload-service-url" toml:"url,omitempty"`
}

func (*UploadServiceConfig) ToAppConfig added in v0.0.13

func (s *UploadServiceConfig) ToAppConfig() (app.UploadServiceConfig, error)

func (*UploadServiceConfig) Validate added in v0.0.13

func (s *UploadServiceConfig) Validate() error

type Validatable

type Validatable interface {
	Validate() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL