Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultConfigPath = "config/config.toml" ConfigFileName = "config.toml" ServiceName = "ssi-service" ConfigExtension = ".toml" DefaultServiceEndpoint = "http://localhost:8080" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseServiceConfig ¶
type BaseServiceConfig struct { Name string `toml:"name"` ServiceEndpoint string `toml:"service_endpoint"` }
BaseServiceConfig represents configurable properties for a specific component of the SSI Service Can be wrapped and extended for any specific service config
type CredentialServiceConfig ¶
type CredentialServiceConfig struct {
*BaseServiceConfig
}
func (*CredentialServiceConfig) IsEmpty ¶
func (c *CredentialServiceConfig) IsEmpty() bool
type DIDServiceConfig ¶
type DIDServiceConfig struct { *BaseServiceConfig Methods []string `toml:"methods"` ResolutionMethods []string `toml:"resolution_methods"` }
func (*DIDServiceConfig) IsEmpty ¶
func (d *DIDServiceConfig) IsEmpty() bool
type IssuingServiceConfig ¶
type IssuingServiceConfig struct {
*BaseServiceConfig
}
func (*IssuingServiceConfig) IsEmpty ¶
func (s *IssuingServiceConfig) IsEmpty() bool
type KeyStoreServiceConfig ¶
type KeyStoreServiceConfig struct { *BaseServiceConfig // Service key password. Used by a KDF whose key is used by a symmetric cypher for key encryption. // The password is salted before usage. ServiceKeyPassword string `toml:"password"` }
func (*KeyStoreServiceConfig) IsEmpty ¶
func (k *KeyStoreServiceConfig) IsEmpty() bool
type ManifestServiceConfig ¶
type ManifestServiceConfig struct {
*BaseServiceConfig
}
func (*ManifestServiceConfig) IsEmpty ¶
func (m *ManifestServiceConfig) IsEmpty() bool
type PresentationServiceConfig ¶
type PresentationServiceConfig struct {
*BaseServiceConfig
}
func (*PresentationServiceConfig) IsEmpty ¶
func (p *PresentationServiceConfig) IsEmpty() bool
type SSIServiceConfig ¶
type SSIServiceConfig struct { conf.Version Server ServerConfig `toml:"server"` Services ServicesConfig `toml:"services"` }
func LoadConfig ¶
func LoadConfig(path string) (*SSIServiceConfig, error)
LoadConfig attempts to load a TOML config file from the given path, and coerce it into our object model. Before loading, defaults are applied on certain properties, which are overwritten if specified in the TOML file.
type SchemaServiceConfig ¶
type SchemaServiceConfig struct {
*BaseServiceConfig
}
func (*SchemaServiceConfig) IsEmpty ¶
func (s *SchemaServiceConfig) IsEmpty() bool
type ServerConfig ¶
type ServerConfig struct { APIHost string `toml:"api_host" conf:"default:0.0.0.0:3000"` DebugHost string `toml:"debug_host" conf:"default:0.0.0.0:4000"` JagerHost string `toml:"jager_host" conf:"http://jaeger:14268/api/traces"` JagerEnabled bool `toml:"jager_enabled" conf:"default:false"` ReadTimeout time.Duration `toml:"read_timeout" conf:"default:5s"` WriteTimeout time.Duration `toml:"write_timeout" conf:"default:5s"` ShutdownTimeout time.Duration `toml:"shutdown_timeout" conf:"default:5s"` LogLocation string `toml:"log_location" conf:"default:log"` LogLevel string `toml:"log_level" conf:"default:debug"` EnableSchemaCaching bool `toml:"enable_schema_caching" conf:"default:true"` }
ServerConfig represents configurable properties for the HTTP server
type ServicesConfig ¶
type ServicesConfig struct { // at present, it is assumed that a single storage provider works for all services // in the future it may make sense to have per-service storage providers (e.g. mysql for one service, // mongo for another) StorageProvider string `toml:"storage"` StorageOption interface{} `toml:"storage_option"` ServiceEndpoint string `toml:"service_endpoint"` // Embed all service-specific configs here. The order matters: from which should be instantiated first, to last KeyStoreConfig KeyStoreServiceConfig `toml:"keystore,omitempty"` DIDConfig DIDServiceConfig `toml:"did,omitempty"` IssuingServiceConfig IssuingServiceConfig `toml:"issuing,omitempty"` SchemaConfig SchemaServiceConfig `toml:"schema,omitempty"` CredentialConfig CredentialServiceConfig `toml:"credential,omitempty"` ManifestConfig ManifestServiceConfig `toml:"manifest,omitempty"` PresentationConfig PresentationServiceConfig `toml:"presentation,omitempty"` }
ServicesConfig represents configurable properties for the components of the SSI Service
Click to show internal directories.
Click to hide internal directories.