Documentation ¶
Index ¶
- Constants
- Variables
- type CacheConfig
- type CertSpec
- type Config
- type DatabaseConfig
- type LocalCacheConfig
- type MetricsConfig
- type MysqlConfig
- type ObjectStorageConfig
- type PostgresConfig
- type RedisCacheConfig
- type RedisConfig
- type RestConfig
- type SecurityConfig
- type ServerConfig
- type TCPListenConfig
- type TCPListenPortRange
- type TLSConfig
Constants ¶
View Source
const ( AttributeID = attribute.Key("d7y.manager.id") AttributePreheatType = attribute.Key("d7y.manager.preheat.type") AttributePreheatURL = attribute.Key("d7y.manager.preheat.url") )
View Source
const ( SpanPreheat = "preheat" SpanGetLayers = "get-layers" SpanAuthWithRegistry = "auth-with-registry" )
View Source
const ( // DatabaseTypeMysql is database type of mysql. DatabaseTypeMysql = "mysql" // DatabaseTypeMariaDB is database type of mariadb. DatabaseTypeMariaDB = "mariadb" // DatabaseTypePostgres is database type of postgres. DatabaseTypePostgres = "postgres" )
View Source
const ( // DefaultServerName is default server name. DefaultServerName = "d7y/manager" // DefaultGRPCPort is default port for grpc server. DefaultGRPCPort = 65003 // DefaultRESTAddr is default address for rest server. DefaultRESTAddr = ":8080" )
View Source
const ( // DefaultRedisDB is default db for redis. DefaultRedisDB = 0 // DefaultRedisBrokerDB is default db for redis broker. DefaultRedisBrokerDB = 1 // DefaultRedisBackendDB is default db for redis backend. DefaultRedisBackendDB = 2 )
View Source
const ( // DefaultRedisCacheTTL is default ttl for redis cache. DefaultRedisCacheTTL = 30 * time.Second // DefaultLFUCacheTTL is default ttl for lfu cache. DefaultLFUCacheTTL = 10 * time.Second // DefaultLFUCacheSize is default size for lfu cache. DefaultLFUCacheSize = 10000 )
View Source
const ( // DefaultMysqlPort is default port for mysql. DefaultMysqlPort = 3306 // DefaultMysqlDBName is default db name for mysql. DefaultMysqlDBName = "manager" )
View Source
const ( // DefaultPostgresPort is default port for postgres. DefaultPostgresPort = 5432 // DefaultPostgresDBName is default db name for postgres. DefaultPostgresDBName = "manager" // DefaultPostgresSSLMode is default ssl mode for postgres. DefaultPostgresSSLMode = "disable" // DefaultPostgresTimezone is default timezone for postgres. DefaultPostgresTimezone = "UTC" )
View Source
const (
// DefaultMetricsAddr is default address for metrics server.
DefaultMetricsAddr = ":8000"
)
Variables ¶
View Source
var ( // DefaultCertIPAddresses is default ip addresses of certificate. DefaultCertIPAddresses = []string{ip.IPv4} // DefaultCertDNSNames is default dns names of certificate. DefaultCertDNSNames = []string{"dragonfly-manager", "dragonfly-manager.dragonfly-system.svc", "dragonfly-manager.dragonfly-system.svc.cluster.local"} // DefaultCertValidityPeriod is default validity period of certificate. DefaultCertValidityPeriod = 10 * 365 * 24 * time.Hour )
Functions ¶
This section is empty.
Types ¶
type CacheConfig ¶
type CacheConfig struct { // Redis cache configuration. Redis *RedisCacheConfig `yaml:"redis" mapstructure:"redis"` // Local cache configuration. Local *LocalCacheConfig `yaml:"local" mapstructure:"local"` }
type CertSpec ¶ added in v2.0.6
type CertSpec struct { // DNSNames is a list of dns names be set on the certificate. DNSNames []string `mapstructure:"dnsNames" yaml:"dnsNames"` // IPAddresses is a list of ip addresses be set on the certificate. IPAddresses []string `mapstructure:"ipAddresses" yaml:"ipAddresses"` // ValidityPeriod is the validity period of certificate. ValidityPeriod time.Duration `mapstructure:"validityPeriod" yaml:"validityPeriod"` }
type Config ¶
type Config struct { // Base options. base.Options `yaml:",inline" mapstructure:",squash"` // Server configuration. Server *ServerConfig `yaml:"server" mapstructure:"server"` // Database configuration. Database *DatabaseConfig `yaml:"database" mapstructure:"database"` // Cache configuration. Cache *CacheConfig `yaml:"cache" mapstructure:"cache"` // ObjectStorage configuration. ObjectStorage *ObjectStorageConfig `yaml:"objectStorage" mapstructure:"objectStorage"` // Metrics configuration. Metrics *MetricsConfig `yaml:"metrics" mapstructure:"metrics"` // Security configuration. Security *SecurityConfig `yaml:"security" mapstructure:"security"` }
type DatabaseConfig ¶
type DatabaseConfig struct { // Database type. Type string `yaml:"type" mapstructure:"type"` // Mysql configuration. Mysql *MysqlConfig `yaml:"mysql" mapstructure:"mysql"` // Postgres configuration. Postgres *PostgresConfig `yaml:"postgres" mapstructure:"postgres"` // Redis configuration. Redis *RedisConfig `yaml:"redis" mapstructure:"redis"` }
type LocalCacheConfig ¶
type MetricsConfig ¶ added in v2.0.4
type MysqlConfig ¶
type MysqlConfig struct { // Server username. User string `yaml:"user" mapstructure:"user"` // Server password. Password string `yaml:"password" mapstructure:"password"` // Server host. Host string `yaml:"host" mapstructure:"host"` // Server port. Port int `yaml:"port" mapstructure:"port"` // Server DB name. DBName string `yaml:"dbname" mapstructure:"dbname"` // TLS mode (can be one of "true", "false", "skip-verify", or "preferred"). TLSConfig string `yaml:"tlsConfig" mapstructure:"tlsConfig"` // Custom TLS configuration (overrides "TLSConfig" setting above). TLS *TLSConfig `yaml:"tls" mapstructure:"tls"` // Enable migration. Migrate bool `yaml:"migrate" mapstructure:"migrate"` }
type ObjectStorageConfig ¶ added in v2.0.4
type ObjectStorageConfig struct { // Enable object storage. Enable bool `yaml:"enable" mapstructure:"enable"` // Object storage name of type, it can be s3 or oss. Name string `mapstructure:"name" yaml:"name"` // Storage region. Region string `mapstructure:"region" yaml:"region"` // Datacenter endpoint. Endpoint string `mapstructure:"endpoint" yaml:"endpoint"` // Access key ID. AccessKey string `mapstructure:"accessKey" yaml:"accessKey"` // Access key secret. SecretKey string `mapstructure:"secretKey" yaml:"secretKey"` }
type PostgresConfig ¶ added in v2.0.5
type PostgresConfig struct { // Server username. User string `yaml:"user" mapstructure:"user"` // Server password. Password string `yaml:"password" mapstructure:"password"` // Server host. Host string `yaml:"host" mapstructure:"host"` // Server port. Port int `yaml:"port" mapstructure:"port"` // Server DB name. DBName string `yaml:"dbname" mapstructure:"dbname"` // SSL mode. SSLMode string `yaml:"sslMode" mapstructure:"sslMode"` // Server timezone. Timezone string `yaml:"timezone" mapstructure:"timezone"` // Enable migration. Migrate bool `yaml:"migrate" mapstructure:"migrate"` }
type RedisCacheConfig ¶
type RedisConfig ¶
type RedisConfig struct { // Server host. Host string `yaml:"host" mapstructure:"host"` // Server port. Port int `yaml:"port" mapstructure:"port"` // Server password. Password string `yaml:"password" mapstructure:"password"` // Server cache DB name. DB int `yaml:"db" mapstructure:"db"` // Server broker DB name. BrokerDB int `yaml:"brokerDB" mapstructure:"brokerDB"` // Server backend DB name. BackendDB int `yaml:"backendDB" mapstructure:"backendDB"` }
type RestConfig ¶
type RestConfig struct { // REST server address. Addr string `yaml:"addr" mapstructure:"addr"` }
type SecurityConfig ¶ added in v2.0.6
type SecurityConfig struct { // AutoIssueCert indicates to issue client certificates for all grpc call. AutoIssueCert bool `yaml:"autoIssueCert" mapstructure:"autoIssueCert"` // CACert is the CA certificate for all grpc tls handshake, it can be path or PEM format string. CACert types.PEMContent `mapstructure:"caCert" yaml:"caCert"` // CAKey is the CA private key, it can be path or PEM format string. CAKey types.PEMContent `mapstructure:"caKey" yaml:"caKey"` // TLSPolicy controls the grpc shandshake behaviors: // force: both ClientHandshake and ServerHandshake are only support tls // prefer: ServerHandshake supports tls and insecure (non-tls), ClientHandshake will only support tls // default: ServerHandshake supports tls and insecure (non-tls), ClientHandshake will only support insecure (non-tls) TLSPolicy string `mapstructure:"tlsPolicy" yaml:"tlsPolicy"` // CertSpec is the desired state of certificate. CertSpec *CertSpec `mapstructure:"certSpec" yaml:"certSpec"` }
type ServerConfig ¶
type ServerConfig struct { // Server name. Name string `yaml:"name" mapstructure:"name"` // Server dynamic config cache directory. CacheDir string `yaml:"cacheDir" mapstructure:"cacheDir"` // Server log directory. LogDir string `yaml:"logDir" mapstructure:"logDir"` // GRPC server configuration. GRPC *TCPListenConfig `yaml:"grpc" mapstructure:"grpc"` // REST server configuration. REST *RestConfig `yaml:"rest" mapstructure:"rest"` }
type TCPListenConfig ¶
type TCPListenConfig struct { // Listen is listen interface, like: 0.0.0.0, 192.168.0.1. Listen string `mapstructure:"listen" yaml:"listen"` // PortRange is listen port. PortRange TCPListenPortRange `yaml:"port" mapstructure:"port"` }
type TCPListenPortRange ¶
type TLSConfig ¶ added in v2.0.2
type TLSConfig struct { // Client certificate file path. Cert string `yaml:"cert" mapstructure:"cert"` // Client key file path. Key string `yaml:"key" mapstructure:"key"` // CA file path. CA string `yaml:"ca" mapstructure:"ca"` // InsecureSkipVerify controls whether a client verifies the // server's certificate chain and host name. InsecureSkipVerify bool `yaml:"insecureSkipVerify" mapstructure:"insecureSkipVerify"` }
Click to show internal directories.
Click to hide internal directories.