Documentation ¶
Index ¶
- Constants
- type Application
- type EtcdFakeKV
- func (c *EtcdFakeKV) Compact(_ context.Context, _ int64, _ ...clientv3.CompactOption) (*clientv3.CompactResponse, error)
- func (c *EtcdFakeKV) Delete(_ context.Context, _ string, _ ...clientv3.OpOption) (*clientv3.DeleteResponse, error)
- func (c *EtcdFakeKV) Do(_ context.Context, _ clientv3.Op) (clientv3.OpResponse, error)
- func (c *EtcdFakeKV) Get(_ context.Context, _ string, _ ...clientv3.OpOption) (*clientv3.GetResponse, error)
- func (c *EtcdFakeKV) Put(_ context.Context, _, _ string, _ ...clientv3.OpOption) (*clientv3.PutResponse, error)
- func (c *EtcdFakeKV) Txn(_ context.Context) clientv3.Txn
Constants ¶
const ( // ServerPort is the port number for the http server of etcd wrapper ServerPort = int64(9095) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { // Config is the application config Config types.Config // contains filtered or unexported fields }
Application is a top level struct which serves as an entry point for this application.
func NewApplication ¶
func NewApplication(ctx context.Context, cancelFn context.CancelFunc, config types.Config, waitReadyTimeout time.Duration, logger *zap.Logger) (*Application, error)
NewApplication initializes and returns an application struct
func (*Application) Close ¶
func (a *Application) Close()
Close closes resources(e.g. etcd client) and cancels the context if not already done so.
func (*Application) RegisterHandler ¶ added in v0.2.0
func (a *Application) RegisterHandler()
RegisterHandler registers the handler for different requests
func (*Application) Setup ¶
func (a *Application) Setup() error
Setup sets up etcd by triggering initialization of the etcd DB.
func (*Application) Start ¶
func (a *Application) Start() error
Start sets up readiness probe and starts an embedded etcd.
type EtcdFakeKV ¶
type EtcdFakeKV struct{}
EtcdFakeKV mocks the KV interface of etcd required to mock etcd get calls
func (*EtcdFakeKV) Compact ¶
func (c *EtcdFakeKV) Compact(_ context.Context, _ int64, _ ...clientv3.CompactOption) (*clientv3.CompactResponse, error)
Compact compacts etcd KV history before the given rev.
func (*EtcdFakeKV) Delete ¶
func (c *EtcdFakeKV) Delete(_ context.Context, _ string, _ ...clientv3.OpOption) (*clientv3.DeleteResponse, error)
Delete deletes an entry with a given key.
func (*EtcdFakeKV) Do ¶
func (c *EtcdFakeKV) Do(_ context.Context, _ clientv3.Op) (clientv3.OpResponse, error)
Do applies a single Op on KV without a transaction.
func (*EtcdFakeKV) Get ¶
func (c *EtcdFakeKV) Get(_ context.Context, _ string, _ ...clientv3.OpOption) (*clientv3.GetResponse, error)
Get gets a value for a given key.