etcd

package
v0.0.0-...-c09e664 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package etcd implements a go-micro/v2/store with etcd

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoSyncInterval

func AutoSyncInterval(d time.Duration) store.Option

AutoSyncInterval is the interval to update endpoints with its latest members. 0 disables auto-sync. By default auto-sync is disabled.

func ClientContext

func ClientContext(ctx context.Context) store.Option

ClientContext is the default etcd3 client context; it can be used to cancel grpc dial out andother operations that do not have an explicit context.

func DialKeepAliveTime

func DialKeepAliveTime(d time.Duration) store.Option

DialKeepAliveTime is the time after which client pings the server to see if transport is alive.

func DialKeepAliveTimeout

func DialKeepAliveTimeout(d time.Duration) store.Option

DialKeepAliveTimeout is the time that the client waits for a response for the keep-alive probe. If the response is not received in this time, the connection is closed.

func DialOptions

func DialOptions(opts []grpc.DialOption) store.Option

DialOptions is a list of dial options for the grpc client (e.g., for interceptors). For example, pass "grpc.WithBlock()" to block until the underlying connection is up. Without this, Dial returns immediately and connecting the server happens in background.

func DialTimeout

func DialTimeout(d time.Duration) store.Option

DialTimeout is the timeout for failing to establish a connection.

func MaxCallRecvMsgSize

func MaxCallRecvMsgSize(size int) store.Option

MaxCallRecvMsgSize is the client-side response receive limit. If 0, it defaults to "math.MaxInt32", because range response can easily exceed request send limits. Make sure that "MaxCallRecvMsgSize" >= server-side default send/recv limit. ("--max-request-bytes" flag to etcd or "embed.Config.MaxRequestBytes").

func MaxCallSendMsgSize

func MaxCallSendMsgSize(size int) store.Option

MaxCallSendMsgSize is the client-side request send limit in bytes. If 0, it defaults to 2.0 MiB (2 * 1024 * 1024). Make sure that "MaxCallSendMsgSize" < server-side default send/recv limit. ("--max-request-bytes" flag to etcd or "embed.Config.MaxRequestBytes").

func NewStore

func NewStore(opts ...store.Option) store.Store

NewStore returns a new etcd store

func Password

func Password(p string) store.Option

Password is a password for authentication.

func PermitWithoutStream

func PermitWithoutStream(b bool) store.Option

PermitWithoutStream when set will allow client to send keepalive pings to server without any active streams(RPCs).

func RejectOldCluster

func RejectOldCluster(b bool) store.Option

RejectOldCluster when set will refuse to create a client against an outdated cluster.

func TLS

func TLS(conf *cryptotls.Config) store.Option

TLS holds the client secure credentials, if any.

func Username

func Username(u string) store.Option

Username is a user name for authentication.

Types

This section is empty.

Jump to

Keyboard shortcuts

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