Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMultihash ¶
CreateMultihash creates a multihash given bytes
func IntOrEmptyInt ¶
IntOrEmptyInt returns an empty int if a int pointer is nil. Otherwise returns the int value of the pointer.
func MultiHashString ¶
MultiHashString create a multihash hex from a string
func StrOrEmptyStr ¶
StrOrEmptyStr returns an empty string if a string pointer is nil. Otherwise returns the string value of the pointer.
Types ¶
type AnyValue ¶
type AnyValue struct {
Value interface{}
}
AnyValue is a GraphQL scalar to represent either a string or a map
func (AnyValue) MarshalGQL ¶
MarshalGQL implements the graphql.Marshaler interface
func (*AnyValue) UnmarshalGQL ¶
UnmarshalGQL implements the graphql.Unmarshaler interface
type IDHubConfig ¶
type IDHubConfig struct { GqlPort int `required:"true" desc:"Sets the ID Hub GraphQL port"` RootCommitsAddress string `required:"true" split_words:"true" desc:"address where root commits are stored"` EthereumDefaultPrivateKey string `required:"true" split_words:"true" desc:"Private key to use when sending Ethereum transactions"` EthAPIURL string `required:"true" envconfig:"eth_api_url" desc:"Ethereum API address"` CronConfig string `envconfig:"cron_config" desc:"Cron config string * * * * *"` PersisterType ccfg.PersisterType `ignored:"true"` PersisterTypeName string `split_words:"true" required:"true" desc:"Sets the persister type to use"` PersisterPostgresAddress string `split_words:"true" desc:"If persister type is Postgresql, sets the address"` PersisterPostgresPort int `split_words:"true" desc:"If persister type is Postgresql, sets the port"` PersisterPostgresDbname string `split_words:"true" desc:"If persister type is Postgresql, sets the database name"` PersisterPostgresUser string `split_words:"true" desc:"If persister type is Postgresql, sets the database user"` PersisterPostgresPw string `split_words:"true" desc:"If persister type is Postgresql, sets the database password"` PersisterPostgresMaxConns *int `split_words:"true" desc:"If persister type is Postgresql, sets the max conns in pool"` PersisterPostgresMaxIdle *int `split_words:"true" desc:"If persister type is Postgresql, sets the max idle conns in pool"` PersisterPostgresConnLife *int `split_words:"true" desc:"If persister type is Postgresql, sets the max conn lifetime in secs"` RedisHosts []string `split_words:"true" desc:"List of Redis host:port for caching and locking"` NatsPersisterDriver string `split_words:"true" desc:"the driver for nats persistence"` NatsID string `envconfig:"nats_id" desc:"the id of the nats server"` NatsPrefix string `split_words:"true" desc:"the prefix for every nats message"` DidUniversalResolverHost *string `split_words:"true" desc:"Sets the host for the universal DID resolver"` DidUniversalResolverPort *int `split_words:"true" desc:"Sets the port for the universal DID resolver"` }
IDHubConfig is the master config for the ID Hub API derived from environment variables.
func (*IDHubConfig) OutputUsage ¶
func (c *IDHubConfig) OutputUsage()
OutputUsage prints the usage string to os.Stdout
func (*IDHubConfig) PopulateFromEnv ¶
func (c *IDHubConfig) PopulateFromEnv() error
PopulateFromEnv processes the environment vars, populates config with the respective values, and validates the values.