Documentation
¶
Index ¶
- Variables
- func GetRedisClient() *redis.Client
- func SetRedisClient(c *redis.Client)
- type AWSSecretManager
- type Application
- type Auth
- type Cluster
- type Clusters
- type Config
- type EKSCluster
- type K8SSecretManager
- type Mode
- type NSQOptions
- type Pyroscope
- type RedisConnectOptions
- type Secret
- type SecretConfig
- type Ssl
- type TLS
- type Task
- type UIServer
Constants ¶
This section is empty.
Variables ¶
View Source
var Cfg = &Config{}
View Source
var FS embed.FS
View Source
var SslConfig = new(Ssl)
Functions ¶
func SetRedisClient ¶ added in v0.3.0
func SetRedisClient(c *redis.Client)
SetRedisClient 设置redis客户端
Types ¶
type AWSSecretManager ¶ added in v0.3.4
type AWSSecretManager struct { SecretName string `yaml:"secretName" json:"secretName"` Region string `yaml:"region" json:"region"` AccessKeyID string `yaml:"accessKeyID" json:"accessKeyID"` SecretAccessKey string `yaml:"secretAccessKey" json:"secretAccessKey"` VersionStage string `yaml:"versionStage" json:"versionStage"` // contains filtered or unexported fields }
type Application ¶
type Application struct { Name string `yaml:"name" json:"name"` Mode Mode `yaml:"mode" json:"mode"` Origin string `yaml:"origin" json:"origin"` StaticPath map[string]string `yaml:"staticPath" json:"staticPath"` Labels map[string]string `yaml:"labels" json:"labels"` UI UIServer `yaml:"ui" json:"ui"` }
func (*Application) Init ¶
func (e *Application) Init(r gin.IRouter)
type Cluster ¶ added in v0.4.6
type Cluster struct { Name string `yaml:"name" json:"name"` KubeConfig string `yaml:"kubeConfig" json:"kubeConfig"` KubeConfigPath string `yaml:"kubeConfigPath" json:"kubeConfigPath"` EKS *EKSCluster `yaml:"eks" json:"eks"` // contains filtered or unexported fields }
func (*Cluster) GetClientSet ¶ added in v0.4.6
func (e *Cluster) GetClientSet() *kubernetes.Clientset
func (*Cluster) GetDynamicClient ¶ added in v0.4.6
func (e *Cluster) GetDynamicClient() *dynamic.DynamicClient
type Clusters ¶ added in v0.4.6
type Clusters []*Cluster
func (Clusters) GetClientSet ¶ added in v0.4.6
func (e Clusters) GetClientSet(name string) *kubernetes.Clientset
func (Clusters) GetDynamicClient ¶ added in v0.4.6
func (e Clusters) GetDynamicClient(name string) *dynamic.DynamicClient
type Config ¶
type Config struct { Auth Auth `yaml:"auth" json:"auth"` GRPC config.GRPC `yaml:"grpc" json:"grpc"` Logger config.Logger `yaml:"logger" json:"logger"` Server config.Listen `yaml:"server" json:"server"` Listen *config.Listen `yaml:"listen" json:"listen"` Database gormdb.Database `yaml:"database" json:"database"` Application Application `yaml:"application" json:"application"` //OAuth2 *config.OAuth2 `yaml:"oauth2" json:"oauth2"` Task Task `yaml:"task" json:"task"` Pyroscope Pyroscope `yaml:"pyroscope" json:"pyroscope"` Cache *config.Cache `yaml:"cache" json:"cache"` Queue *config.Queue `yaml:"queue" json:"queue"` Locker *config.Locker `yaml:"locker" json:"locker"` Secret *Secret `yaml:"secret" json:"secret"` Storage *config.Storage `yaml:"storage" json:"storage"` Clusters Clusters `yaml:"clusters" json:"clusters"` }
type EKSCluster ¶ added in v0.4.6
type EKSCluster struct { Name string `yaml:"name" json:"name"` Region string `yaml:"region" json:"region"` }
func (*EKSCluster) GetKubeconfig ¶ added in v0.4.6
func (e *EKSCluster) GetKubeconfig() (*clientcmdapi.Config, error)
type K8SSecretManager ¶ added in v0.3.4
type K8SSecretManager struct { Namespace string `yaml:"namespace" json:"namespace"` SecretName string `yaml:"secretName" json:"secretName"` KubeConfig string `yaml:"kubeConfig" json:"kubeConfig"` KubeConfigPath string `yaml:"kubeConfigPath" json:"kubeConfigPath"` // contains filtered or unexported fields }
type NSQOptions ¶ added in v0.3.0
type NSQOptions struct { DialTimeout time.Duration `opt:"dial_timeout" default:"1s"` LookupdAddr string `opt:"-" json:"lookupdAddr" yaml:"lookupdAddr"` AdminAddr string `opt:"-" json:"adminAddr" yaml:"adminAddr"` // Deadlines for network reads and writes ReadTimeout time.Duration `opt:"read_timeout" min:"100ms" max:"5m" default:"60s"` WriteTimeout time.Duration `opt:"write_timeout" min:"100ms" max:"5m" default:"1s"` // Addresses is the local address to use when dialing an nsqd. Addresses []string `opt:"addresses" yaml:"addresses" json:"addresses"` // Duration between polling lookupd for new producers, and fractional jitter to add to // the lookupd pool loop. this helps evenly distribute requests even if multiple consumers // restart at the same time // // NOTE: when not using nsqlookupd, LookupdPollInterval represents the duration of time between // reconnection attempts LookupdPollInterval time.Duration `opt:"lookupd_poll_interval" min:"10ms" max:"5m" default:"60s"` LookupdPollJitter float64 `opt:"lookupd_poll_jitter" min:"0" max:"1" default:"0.3"` // Maximum duration when REQueueing (for doubling of deferred requeue) MaxRequeueDelay time.Duration `opt:"max_requeue_delay" min:"0" max:"60m" default:"15m"` DefaultRequeueDelay time.Duration `opt:"default_requeue_delay" min:"0" max:"60m" default:"90s"` // Maximum amount of time to backoff when processing fails 0 == no backoff MaxBackoffDuration time.Duration `opt:"max_backoff_duration" min:"0" max:"60m" default:"2m"` // Unit of time for calculating consumer backoff BackoffMultiplier time.Duration `opt:"backoff_multiplier" min:"0" max:"60m" default:"1s"` // Maximum number of times this consumer will attempt to process a message before giving up MaxAttempts uint16 `opt:"max_attempts" min:"0" max:"65535" default:"5"` // Duration to wait for a message from an nsqd when in a state where RDY // counts are re-distributed (e.g. max_in_flight < num_producers) LowRdyIdleTimeout time.Duration `opt:"low_rdy_idle_timeout" min:"1s" max:"5m" default:"10s"` // Duration to wait until redistributing RDY for an nsqd regardless of LowRdyIdleTimeout LowRdyTimeout time.Duration `opt:"low_rdy_timeout" min:"1s" max:"5m" default:"30s"` // Duration between redistributing max-in-flight to connections RDYRedistributeInterval time.Duration `opt:"rdy_redistribute_interval" min:"1ms" max:"5s" default:"5s"` // Identifiers sent to nsqd representing this client // UserAgent is in the spirit of HTTP (default: "<client_library_name>/<version>") ClientID string `opt:"client_id"` // (defaults: short hostname) Hostname string `opt:"hostname"` UserAgent string `opt:"user_agent"` // Duration of time between heartbeats. This must be less than ReadTimeout HeartbeatInterval time.Duration `opt:"heartbeat_interval" default:"30s"` // Integer percentage to sample the channel (requires nsqd 0.2.25+) SampleRate int32 `opt:"sample_rate" min:"0" max:"99"` Tls *TLS `yaml:"tls" json:"tls"` // Compression Settings Deflate bool `opt:"deflate"` DeflateLevel int `opt:"deflate_level" min:"1" max:"9" default:"6"` Snappy bool `opt:"snappy"` // Size of the buffer (in bytes) used by nsqd for buffering writes to this connection OutputBufferSize int64 `opt:"output_buffer_size" default:"16384"` // Timeout used by nsqd before flushing buffered writes (set to 0 to disable). // // WARNING: configuring clients with an extremely low // (< 25ms) output_buffer_timeout has a significant effect // on nsqd CPU usage (particularly with > 50 clients connected). OutputBufferTimeout time.Duration `opt:"output_buffer_timeout" default:"250ms"` // Maximum number of messages to allow in flight (concurrency knob) MaxInFlight int `opt:"max_in_flight" min:"0" default:"1"` // The server-side message timeout for messages delivered to this client MsgTimeout time.Duration `opt:"msg_timeout" min:"0"` // secret for nsqd authentication (requires nsqd 0.2.29+) AuthSecret string `opt:"auth_secret"` }
func (NSQOptions) GetNSQOptions ¶ added in v0.3.0
func (e NSQOptions) GetNSQOptions() (*nsq.Config, error)
type Pyroscope ¶
type Pyroscope struct { Enabled bool `yaml:"enabled" json:"enabled"` ApplicationName string `yaml:"applicationName" json:"applicationName"` // e.g backend.purchases Tags map[string]string `yaml:"tags" json:"tags"` ServerAddress string `yaml:"serverAddress" json:"serverAddress"` // e.g http://pyroscope.services.internal:4040 AuthToken string `yaml:"authToken" json:"authToken"` // specify this token when using pyroscope cloud BasicAuthUser string `yaml:"basicAuthUser" json:"basicAuthUser"` // http basic auth user BasicAuthPassword string `yaml:"basicAuthPassword" json:"basicAuthPassword"` // http basic auth password TenantID string `yaml:"tenantID" json:"tenantID"` UploadRate time.Duration `yaml:"uploadRate" json:"uploadRate"` Logger bool `yaml:"logger" json:"logger"` ProfileTypes []pyroscope.ProfileType `yaml:"profileTypes" json:"profileTypes"` DisableGCRuns bool `yaml:"disableGCRuns" json:"disableGCRuns"` // this will disable automatic runtime.GC runs between getting the heap profiles DisableAutomaticResets bool `yaml:"disableAutomaticResets" json:"disableAutomaticResets"` // disable automatic profiler reset every 10 seconds. Reset manually by calling Flush method HTTPHeaders map[string]string `yaml:"httpHeaders" json:"httpHeaders"` }
type RedisConnectOptions ¶ added in v0.3.0
type RedisConnectOptions struct { Network string `yaml:"network" json:"network"` Addr string `yaml:"addr" json:"addr"` Username string `yaml:"username" json:"username"` Password string `yaml:"password" json:"password"` DB int `yaml:"db" json:"db"` PoolSize int `yaml:"pool_size" json:"pool_size"` Tls *TLS `yaml:"tls" json:"tls"` MaxRetries int `yaml:"max_retries" json:"max_retries"` }
func (RedisConnectOptions) GetRedisOptions ¶ added in v0.3.0
func (e RedisConnectOptions) GetRedisOptions() (*redis.Options, error)
type Secret ¶ added in v0.3.4
type Secret struct { EnvPrefix string `yaml:"envPrefix" json:"envPrefix"` Keys []string `yaml:"keys" json:"keys"` AWS *AWSSecretManager `yaml:"aws" json:"aws"` K8S *K8SSecretManager `yaml:"k8s" json:"k8s"` }
type SecretConfig ¶ added in v0.3.4
type SecretConfig struct {
Secret *Secret `yaml:"secret" json:"secret"`
}
func (*SecretConfig) Init ¶ added in v0.3.4
func (s *SecretConfig) Init()
Click to show internal directories.
Click to hide internal directories.