config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0, MIT Imports: 22 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"`
	UCAN     UCANConfig     `mapstructure:"ucan" toml:"ucan"`
}

func (Client) Validate added in v0.0.13

func (c Client) Validate() error

type ContractAddresses added in v0.1.0

type ContractAddresses struct {
	Verifier         string `mapstructure:"verifier" validate:"required" flag:"verifier-address" toml:"verifier,omitempty"`
	ProviderRegistry string `mapstructure:"provider_registry" validate:"required" flag:"provider-registry-address" toml:"provider_registry,omitempty"`
	Service          string `mapstructure:"service" validate:"required" flag:"service-address" toml:"service,omitempty"`
	ServiceView      string `mapstructure:"service_view" validate:"required" flag:"service-view-address" toml:"service_view,omitempty"`
}

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"`
	// According to the spec, batch size should be between 10MiB and 1GiB
	// (see https://github.com/storacha/specs/blob/main/w3-egress-tracking.md)
	MaxBatchSizeBytes int64  `` /* 156-byte string literal not displayed */
	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 {
	Network     string            `mapstructure:"network" validate:"required" flag:"network" toml:"network"`
	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 PDPServiceConfig added in v0.0.13

type PDPServiceConfig struct {
	OwnerAddress   string               `mapstructure:"owner_address" validate:"required" flag:"owner-address" toml:"owner_address"`
	LotusEndpoint  string               `mapstructure:"lotus_endpoint" validate:"required" flag:"lotus-endpoint" toml:"lotus_endpoint"`
	SigningService SigningServiceConfig `mapstructure:"signing_service" validate:"required" toml:"signing_service,omitempty"`
	Contracts      ContractAddresses    `mapstructure:"contracts" validate:"required" toml:"contracts,omitempty"`
	ChainID        string               `mapstructure:"chain_id" validate:"required" flag:"chain-id" toml:"chain_id,omitempty"`
	PayerAddress   string               `mapstructure:"payer_address" validate:"required" flag:"payer-address" toml:"payer_address,omitempty"`
}

func (PDPServiceConfig) ToAppConfig added in v0.0.13

func (c 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 SigningServiceConfig added in v0.0.17

type SigningServiceConfig struct {
	// Identity of the signing service
	DID string `mapstructure:"did" toml:"did,omitempty"`
	// URL endpoint for remote signing service (if using HTTP client)
	URL string `mapstructure:"url" toml:"url,omitempty"`
	// Private key for in-process signing (if using local signer)
	// This should be a hex-encoded private key string
	// NB: this should only be used for development purposes
	PrivateKey string `mapstructure:"private_key" toml:"private_key,omitempty"`
}

SigningServiceConfig configures the signing service for PDP operations

func (SigningServiceConfig) ToAppConfig added in v0.0.17

func (SigningServiceConfig) Validate added in v0.0.17

func (c SigningServiceConfig) Validate() error

type UCANConfig added in v0.1.0

type UCANConfig struct {
	ProofSetID uint64 `mapstructure:"proof_set" toml:"proof_set"`
}

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"`
}

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