base

package
v0.0.0-...-b4926d4 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulStorageClient

type ConsulStorageClient struct {
	// contains filtered or unexported fields
}

TODO: evaluate efficiency of LSing a whole dir on every op so far this is preferable to caring what files are named

func NewConsulStorageClient

func NewConsulStorageClient(rootPath string, consul *api.Client) *ConsulStorageClient

func (*ConsulStorageClient) Create

func (c *ConsulStorageClient) Create(item *StorableItem) (*StorableItem, error)

func (*ConsulStorageClient) Delete

func (c *ConsulStorageClient) Delete(name string) error

func (*ConsulStorageClient) Get

func (c *ConsulStorageClient) Get(name string) (*StorableItem, error)

func (*ConsulStorageClient) List

func (c *ConsulStorageClient) List() ([]*StorableItem, error)

func (*ConsulStorageClient) Update

func (c *ConsulStorageClient) Update(item *StorableItem) (*StorableItem, error)

func (*ConsulStorageClient) Watch

func (c *ConsulStorageClient) Watch(handlers ...StorableItemEventHandler) (*storage.Watcher, error)

TODO: be clear that watch for consul only calls update

type StorableItem

type StorableItem struct {
	Upstream    *v1.Upstream
	VirtualHost *v1.VirtualHost
	File        *dependencies.File
}

func (*StorableItem) GetBytes

func (item *StorableItem) GetBytes() ([]byte, error)

func (*StorableItem) GetName

func (item *StorableItem) GetName() string

func (*StorableItem) GetResourceVersion

func (item *StorableItem) GetResourceVersion() string

func (*StorableItem) GetTypeFlag

func (item *StorableItem) GetTypeFlag() StorableItemType

func (*StorableItem) SetResourceVersion

func (item *StorableItem) SetResourceVersion(rv string)

type StorableItemEventHandler

type StorableItemEventHandler struct {
	UpstreamEventHandler    storage.UpstreamEventHandler
	VirtualHostEventHandler storage.VirtualHostEventHandler
	FileEventHandler        dependencies.FileEventHandler
}

type StorableItemType

type StorableItemType uint64
const (
	StorableItemTypeUpstream StorableItemType = iota
	StorableItemTypeVirtualHost
	StorableItemTypeFile
)

Jump to

Keyboard shortcuts

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