conf

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type A3SClientConf

type A3SClientConf struct {
	A3SURL                  string `mapstructure:"a3s-url"               desc:"URL of the a3s server"                                `
	A3SNamespace            string `mapstructure:"a3s-namespace"         desc:"Namespace"`
	A3SCertificateAuthority string `mapstructure:"a3s-cacert"            desc:"Path to the CA certificate"                           secret:"true" file:"true"`
	A3SClientCert           string `mapstructure:"a3s-cert"              desc:"Path to the client certificate"                       secret:"true" file:"true"`
	A3SClientKey            string `mapstructure:"a3s-key"               desc:"Path to the client key"                               secret:"true" file:"true"`
	A3SClientKeyPass        string `mapstructure:"a3s-key-pass"          desc:"Password for the client key"                          secret:"true" file:"true"`
	A3SourceName            string `mapstructure:"a3s-source-name"       desc:"Name of the source to utilize by default"             default:"gateway"`
	// contains filtered or unexported fields
}

A3SClientConf holds a3s config.

func (*A3SClientConf) SystemCAPool

func (c *A3SClientConf) SystemCAPool() (*x509.CertPool, error)

SystemCAPool returns the system signing pool

type APIServerConf

type APIServerConf struct {
	PublicAPIURL          string   `mapstructure:"public-api-url"            desc:"Publicly announced API URL"`
	CORSAdditionalOrigins []string `mapstructure:"cors-additional-origins"   desc:"Set additional allowed origin for CORS"`
	CORSDefaultOrigin     string   `mapstructure:"cors-default-origin"       desc:"Set the default allowed origin for CORS"`
	ListenAddress         string   `mapstructure:"listen"                    desc:"Listening address"                                    default:":443"`
	MaxConnections        int      `mapstructure:"max-conns"                 desc:"Max number concurrent TCP connection"`
	MaxProcs              int      `mapstructure:"max-procs"                 desc:"Set the max number thread Go will start"`
	TLSCertificate        string   `mapstructure:"tls-cert"                  desc:"Path to the certificate for https"`
	TLSClientCA           string   `mapstructure:"tls-client-ca"             desc:"Path to the CA to use to verify client certificates"`
	TLSDisable            bool     `mapstructure:"tls-disable"               desc:"Completely disable TLS support"`
	TLSKey                string   `mapstructure:"tls-key"                   desc:"Path to the key for https"`
	TLSKeyPass            string   `` /* 126-byte string literal not displayed */
}

APIServerConf holds the basic server conf.

func (*APIServerConf) TLSConfig

func (c *APIServerConf) TLSConfig() (*tls.Config, error)

TLSConfig returns the configured TLS configuration as *tls.Config.

type GatewayConf

type GatewayConf struct {
	GWAnnouncedAddress string   `mapstructure:"gw-announce-address" desc:"If set, announce as the service address to the gateway"`
	GWTopic            string   `mapstructure:"gw-topic"            desc:"Topic to use for gateway services discovery"`
	GWOverridePrivate  []string `` /* 164-byte string literal not displayed */
	GWAnnouncePrefix   string   `mapstructure:"gw-announce-prefix"  desc:"Sets the prefix to use for the bahaamut gateway announcement"`
}

GatewayConf holds the configuration for the bahamut gateway behaviors.

func (*GatewayConf) GWPrivateOverrides

func (c *GatewayConf) GWPrivateOverrides() map[elemental.Identity]bool

GWPrivateOverrides returns the private overrides in the needed format.

type HTTPTimeoutsConf

type HTTPTimeoutsConf struct {
	TimeoutRead  time.Duration `mapstructure:"timeout-read"              desc:"Read timeout for the http requests"         default:"120s"`
	TimeoutWrite time.Duration `mapstructure:"timeout-write"             desc:"Write timeout for the http requests"        default:"240s"`
	TimeoutIdle  time.Duration `mapstructure:"timeout-idle"              desc:"Idle timeout for the http requests"         default:"240s"`
}

HTTPTimeoutsConf holds http server timeout.

type HealthConfiguration

type HealthConfiguration struct {
	HealthListenAddress string `mapstructure:"health-listen"            desc:"Listening address for the health server"     default:":80"`
	EnableHealth        bool   `mapstructure:"health-enabled"           desc:"Enable the health check server"`
}

HealthConfiguration holds the configuration for health.

type LoggingConf

type LoggingConf struct {
	LogFormat    string `mapstructure:"log-format" desc:"Log format"                    default:"json"`
	LogLevel     string `mapstructure:"log-level"  desc:"Log level"                     default:"info"`
	LogTracerURL string `mapstructure:"log-tracer" desc:"url of opentracing collector"`
}

LoggingConf is the configuration for log.

type MTLSHeaderConf

type MTLSHeaderConf struct {
	Enabled    bool   `` /* 188-byte string literal not displayed */
	HeaderKey  string `mapstructure:"mtls-header-key"        desc:"The header to check for user certificates" default:"x-tls-certificate"`
	Passphrase string `` /* 153-byte string literal not displayed */
}

MTLSHeaderConf holds the conf for the secure MTLS header.

type MongoConf

type MongoConf struct {
	MongoAttrEncryptKey string `mapstructure:"mongo-encryption-key" desc:"Key to use for attributes encryption"         secret:"true" file:"true"`
	MongoAuthDB         string `mapstructure:"mongo-auth-db"        desc:"Database to use for authenticating"           default:"admin"`
	MongoConsistency    string `` /* 157-byte string literal not displayed */
	MongoDBName         string `mapstructure:"mongo-db"             desc:"Database name in MongoDB"                     default:"override-me"`
	MongoPassword       string `mapstructure:"mongo-pass"           desc:"Password to use to connect to Mongo"          secret:"true" file:"true"`
	MongoPoolSize       int    `mapstructure:"mongo-pool-size"      desc:"Maximum size of the connection pool"          default:"4096"`
	MongoTLSCA          string `mapstructure:"mongo-custom-ca"      desc:"Custom certificate authority"`
	MongoTLSCertificate string `mapstructure:"mongo-tls-cert"       desc:"Path to the client certificate"`
	MongoTLSDisable     bool   `mapstructure:"mongo-tls-disable"    desc:"Set this to completely disable TLS"           hidden:"true"`
	MongoTLSSkip        bool   `mapstructure:"mongo-tls-skip"       desc:"Skip CA verification"`
	MongoTLSKey         string `mapstructure:"mongo-tls-key"        desc:"Path to the client key"`
	MongoTLSKeyPass     string `mapstructure:"mongo-tls-key-pass"   desc:"Password for the client key"                  secret:"true" file:"true"`
	MongoURL            string `mapstructure:"mongo-url"            desc:"Mongo connection string"                      required:"true"`
	MongoUser           string `mapstructure:"mongo-user"           desc:"User to use to connect to MongoDB"`
}

MongoConf holds the configuration for mongo db authentication.

func (*MongoConf) TLSConfig

func (c *MongoConf) TLSConfig() (*tls.Config, error)

TLSConfig returns the configured TLS configuration as *tls.Config.

type NATSConf

type NATSConf struct {
	NATSClientID       string `mapstructure:"nats-client-id"                 desc:"Nats client ID"`
	NATSClusterID      string `mapstructure:"nats-cluster-id"                desc:"Nats cluster ID"                                default:"test-cluster"`
	NATSPassword       string `mapstructure:"nats-pass"                      desc:"Password to use to connect to Nats"             secret:"true" file:"true"`
	NATSTLSCA          string `mapstructure:"nats-tls-ca"                    desc:"Path to the CA used by Nats"`
	NATSTLSCertificate string `mapstructure:"nats-tls-cert"                  desc:"Path to the client certificate"`
	NATSTLSDisable     bool   `mapstructure:"nats-tls-disable"               desc:"Disable TLS completely"`
	NATSTLSKey         string `mapstructure:"nats-tls-key"                   desc:"Path to the client key"`
	NATSTLSKeyPass     string `mapstructure:"nats-tls-key-pass"              desc:"Password for the client key"                    secret:"true" file:"true"`
	NATSTLSSkip        bool   `mapstructure:"nats-tls-skip"                  desc:"Skip CA verification"`
	NATSURL            string `mapstructure:"nats-url"                       desc:"URL of the nats service"`
	NATSUser           string `mapstructure:"nats-user"                      desc:"User name to use to connect to Nats"            secret:"true" file:"true"`
}

NATSConf holds the configuration for pubsub connection.

func (*NATSConf) TLSConfig

func (c *NATSConf) TLSConfig() (*tls.Config, error)

TLSConfig returns the configured TLS configuration as *tls.Config.

type NATSConsumerConf

type NATSConsumerConf struct {
	NATSGroupName      string `mapstructure:"nats-group-name"           desc:"Nats group name"                             default:"main"`
	NATSSubscribeTopic string `mapstructure:"nats-subscribe-topic"      desc:"Topic to use to receive updates"             default:"override-me"`

	NATSConf `mapstructure:",squash"`
}

NATSConsumerConf holds the config a Pubsub consumer.

type NATSPublisherConf

type NATSPublisherConf struct {
	NATSPublishTopic string `mapstructure:"nats-publish-topic"        desc:"Topic to use to push events"                 default:"events"`

	NATSConf `mapstructure:",squash"`
}

NATSPublisherConf holds the config a Pubsub publisher.

type ProfilingConf

type ProfilingConf struct {
	ProfilingListenAddress string `mapstructure:"profiling-listen"      desc:"Listening address for the profiling server"  default:":6060"`
	ProfilingEnabled       bool   `mapstructure:"profiling-enabled"     desc:"Enable the profiling server"`
}

ProfilingConf holds the configuration for profiling.

type RateLimitingConf

type RateLimitingConf struct {
	RateLimitingBurst   int  `mapstructure:"rate-limit-burst"   desc:"Burst value"                                 default:"500"`
	RateLimitingEnabled bool `mapstructure:"rate-limit-enabled" desc:"Enable global rate limiting"`
	RateLimitingRPS     int  `mapstructure:"rate-limit-rps"     desc:"Requests per seconds"                        default:"2000"`
}

RateLimitingConf holds the configuration for rate limiting.

Jump to

Keyboard shortcuts

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