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 db.DB Coordinator sync.Coordinator Metrics metrics.Metrics 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 Agent.
func New ¶
func New( conf *Config, mongoConf *mongo.Config, etcdConf *etcd.Config, rpcAddr string, met metrics.Metrics, ) (*Backend, error)
New creates a new instance of Backend.
func (*Backend) AttachGoroutine ¶
func (b *Backend) AttachGoroutine(f func())
AttachGoroutine creates a goroutine on a given function and tracks it using the backend's WaitGroup.
type Config ¶
type Config struct { // 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 `json:"SnapshotThreshold"` // SnapshotInterval is the interval of changes to create a snapshot. SnapshotInterval uint64 `json:"SnapshotInterval"` // AuthWebhookURL is the url of the authorization webhook. AuthWebhookURL string `json:"AuthWebhookURL"` // AuthWebhookMethods is the methods that run the authorization webhook. AuthWebhookMethods []string `json:"AuthWebhookMethods"` // AuthWebhookMaxRetries is the max count that retries the authorization webhook. AuthWebhookMaxRetries uint64 `json:"AuthWebhookMaxRetries"` // AuthWebhookMaxWaitInterval is the max interval that waits before retrying the authorization webhook. AuthWebhookMaxWaitInterval string `json:"AuthWebhookMaxWaitInterval"` // AuthWebhookCacheAuthTTL is the TTL value to set when caching the authorized result. AuthWebhookCacheAuthTTL string `json:"AuthWebhookCacheAuthTTL"` // AuthWebhookCacheUnauthTTL is the TTL value to set when caching the unauthorized result. AuthWebhookCacheUnauthTTL string `json:"AuthWebhookCacheUnauthTTL"` }
Config is the configuration for creating a Backend instance.
func (*Config) ParseAuthWebhookCacheAuthTTL ¶ added in v0.1.7
ParseAuthWebhookCacheAuthTTL returns TTL for authorized cache.
func (*Config) ParseAuthWebhookCacheUnauthTTL ¶ added in v0.1.7
ParseAuthWebhookCacheUnauthTTL returns TTL for unauthorized cache.
func (*Config) ParseAuthWebhookMaxWaitInterval ¶ added in v0.1.7
ParseAuthWebhookMaxWaitInterval returns max wait interval.
func (*Config) RequireAuth ¶ added in v0.1.6
RequireAuth returns whether the given method require authorization.
Click to show internal directories.
Click to hide internal directories.