Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct { Config *Config DB database.Database Coordinator sync.Coordinator Metrics *prometheus.Metrics Background *background.Background Housekeeping *housekeeping.Housekeeping AuthWebhookCache *cache.LRUExpireCache // contains filtered or unexported fields }
Backend manages Yorkie's backend such as Database and Coordinator. And it has the server status such as the information of this Server.
func New ¶
func New( conf *Config, mongoConf *mongo.Config, etcdConf *etcd.Config, housekeepingConf *housekeeping.Config, clusterAddr string, metrics *prometheus.Metrics, ) (*Backend, error)
New creates a new instance of Backend.
type Config ¶
type Config struct { // UseDefaultProject is whether to use the default project. Even if public // key is not provided from the client, the default project will be used. If // we are using server as single-tenant mode, this should be set to true. UseDefaultProject bool `yaml:"UseDefaultProject"` // SnapshotThreshold is the threshold that determines if changes should be // sent with snapshot when the number of changes is greater than this value. SnapshotThreshold uint64 `yaml:"SnapshotThreshold"` // SnapshotInterval is the interval of changes to create a snapshot. SnapshotInterval uint64 `yaml:"SnapshotInterval"` // AuthWebhookMaxRetries is the max count that retries the authorization webhook. AuthWebhookMaxRetries uint64 `yaml:"AuthWebhookMaxRetries"` // AuthWebhookMaxWaitInterval is the max interval that waits before retrying the authorization webhook. AuthWebhookMaxWaitInterval string `yaml:"AuthWebhookMaxWaitInterval"` // AuthWebhookCacheSize is the cache size of the authorization webhook. AuthWebhookCacheSize int `yaml:"AuthWebhookCacheSize"` // AuthWebhookCacheAuthTTL is the TTL value to set when caching the authorized result. AuthWebhookCacheAuthTTL string `yaml:"AuthWebhookCacheAuthTTL"` // AuthWebhookCacheUnauthTTL is the TTL value to set when caching the unauthorized result. AuthWebhookCacheUnauthTTL string `yaml:"AuthWebhookCacheUnauthTTL"` }
Config is the configuration for creating a Backend instance.
func (*Config) ParseAuthWebhookCacheAuthTTL ¶
ParseAuthWebhookCacheAuthTTL returns TTL for authorized cache.
func (*Config) ParseAuthWebhookCacheUnauthTTL ¶
ParseAuthWebhookCacheUnauthTTL returns TTL for unauthorized cache.
func (*Config) ParseAuthWebhookMaxWaitInterval ¶
ParseAuthWebhookMaxWaitInterval returns max wait interval.
Click to show internal directories.
Click to hide internal directories.