app

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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

Compact compacts etcd KV history before the given rev.

func (*EtcdFakeKV) Delete

Delete deletes an entry with a given key.

func (*EtcdFakeKV) Do

Do applies a single Op on KV without a transaction.

func (*EtcdFakeKV) Get

Get gets a value for a given key.

func (*EtcdFakeKV) Put

Put puts a value for a given key.

func (*EtcdFakeKV) Txn

Txn creates a transaction.

Jump to

Keyboard shortcuts

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