Documentation
¶
Index ¶
- Constants
- func Load[T Validatable]() (T, error)
- type API
- type BlobStorageConfig
- type Client
- type ContractAddresses
- type Credentials
- type EgressTrackerServiceConfig
- type FullServerConfig
- type IdentityConfig
- type IndexingServiceConfig
- type LocalConfig
- type MinioConfig
- type Normalizable
- type PDPServiceConfig
- type PublisherServiceConfig
- type RepoConfig
- type ServerConfig
- type ServicesConfig
- type SigningServiceConfig
- type TelemetryCollectorConfig
- type TelemetryConfig
- type UCANConfig
- type UCANServerConfig
- type UCANServiceConfig
- type UploadServiceConfig
- type Validatable
Constants ¶
View Source
const DefaultMinimumEgressBatchSize int64 = 10 * 1024 * 1024
DefaultMinimumEgressBatchSize is the minimum allowed egress tracker batch size (10 MiB).
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 BlobStorageConfig ¶ added in v0.1.1
type BlobStorageConfig struct {
Minio MinioConfig `mapstructure:"minio" toml:"minio,omitempty"`
}
BlobStorageConfig is special configuration allowing blobs to be stored outside the main repo or on a remote device.
type Client ¶ added in v0.0.13
type Client struct {
Identity IdentityConfig `mapstructure:"identity"`
API API `mapstructure:"api"`
UCAN UCANConfig `mapstructure:"ucan" toml:"ucan"`
}
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"`
Payments string `mapstructure:"payments" flag:"payments-address" toml:"payments,omitempty"`
USDFCToken string `mapstructure:"usdfc_token" flag:"usdfc-token-address" toml:"usdfc_token,omitempty"`
}
type Credentials ¶ added in v0.1.1
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 `` /* 163-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 (c *EgressTrackerServiceConfig) ToAppConfig() (app.EgressTrackerServiceConfig, error)
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"`
Telemetry TelemetryConfig `mapstructure:"telemetry" toml:"telemetry,omitempty"`
}
func (*FullServerConfig) Normalize ¶ added in v0.1.1
func (f *FullServerConfig) Normalize()
Normalize applies compatibility fixes before validation.
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 (s *IndexingServiceConfig) ToAppConfig() (app.IndexingServiceConfig, error)
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 MinioConfig ¶ added in v0.1.1
type MinioConfig struct {
Endpoint string `mapstructure:"endpoint" validate:"required" toml:"endpoint"`
Bucket string `mapstructure:"bucket" validate:"required" toml:"bucket"`
Credentials Credentials `mapstructure:"credentials" toml:"credentials,omitempty"`
Insecure bool `mapstructure:"insecure" toml:"insecure,omitempty"`
}
type Normalizable ¶ added in v0.1.1
type Normalizable interface {
Normalize()
}
Normalizable allows configs to adjust legacy/default values prior to validation.
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"`
BlobStorage *BlobStorageConfig `mapstructure:"blob_storage" validate:"omitempty" toml:"blob_storage,omitempty"`
}
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) Normalize ¶ added in v0.1.1
func (s *ServicesConfig) Normalize()
Normalize applies compatibility fixes before validation.
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 (c SigningServiceConfig) ToAppConfig() (app.SigningServiceConfig, error)
func (SigningServiceConfig) Validate ¶ added in v0.0.17
func (c SigningServiceConfig) Validate() error
type TelemetryCollectorConfig ¶ added in v0.2.1
type TelemetryCollectorConfig struct {
Endpoint string `mapstructure:"endpoint" validate:"required" toml:"endpoint"`
Insecure bool `mapstructure:"insecure" toml:"insecure,omitempty"`
Headers map[string]string `mapstructure:"headers" toml:"headers,omitempty"`
PublishInterval time.Duration `mapstructure:"publish_interval" toml:"publish_interval,omitempty"`
}
type TelemetryConfig ¶ added in v0.2.1
type TelemetryConfig struct {
Metrics []TelemetryCollectorConfig `mapstructure:"metrics" toml:"metrics,omitempty"`
Traces []TelemetryCollectorConfig `mapstructure:"traces" toml:"traces,omitempty"`
DisableStorachaAnalytics bool `mapstructure:"disable_storacha_analytics" toml:"disable_storacha_analytics,omitempty"`
}
func (TelemetryConfig) ToAppConfig ¶ added in v0.2.1
func (t TelemetryConfig) ToAppConfig() app.TelemetryConfig
func (TelemetryConfig) Validate ¶ added in v0.2.1
func (t TelemetryConfig) 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) Normalize ¶ added in v0.1.1
func (u *UCANServerConfig) Normalize()
Normalize applies compatibility fixes before validation.
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) Normalize ¶ added in v0.1.1
func (s *UCANServiceConfig) Normalize()
Normalize applies compatibility fixes before validation.
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
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.