consul

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeDefault = ""
	TypeJson    = "json"
	TypeBase64  = "base64"
)

Variables

View Source
var (
	ErrUndefinedType = errors.New("undefined key type")
)
View Source
var (
	ErrUnsupportedFormat = errors.New("unsupported format")
)

Functions

func FileEncode

func FileEncode(filename string, kv KVList) error

func IsAllowedExtension

func IsAllowedExtension(filename string) bool

Types

type ConsulMigrate

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

func CreateConsulMigrate

func CreateConsulMigrate(addr string) (*ConsulMigrate, error)

func NewConsulMigrate

func NewConsulMigrate(cli *api.Client) *ConsulMigrate

func (*ConsulMigrate) Dump

func (m *ConsulMigrate) Dump() (KVList, error)

func (*ConsulMigrate) DumpToFile

func (m *ConsulMigrate) DumpToFile(filename string) error

func (*ConsulMigrate) Migrate

func (m *ConsulMigrate) Migrate(kv KVList) error

func (*ConsulMigrate) MigrateFromDir

func (m *ConsulMigrate) MigrateFromDir(path string) error

func (*ConsulMigrate) MigrateFromFile

func (m *ConsulMigrate) MigrateFromFile(filename string) error

type KVItem

type KVItem struct {
	Key   string `yaml:"key" json:"key"`
	Value string `yaml:"value,omitempty" json:"value,omitempty"`
	Type  string `yaml:"type,omitempty" json:"type,omitempty"`
}

func (KVItem) DetectType

func (kvi KVItem) DetectType() string

func (KVItem) Validate

func (kvi KVItem) Validate() error

func (KVItem) ValueBytes

func (kvi KVItem) ValueBytes() ([]byte, error)

type KVList

type KVList []KVItem

func DirDecode

func DirDecode(path string) (KVList, error)

func FileDecode

func FileDecode(filename string) (KVList, error)

func (KVList) Validate

func (kvl KVList) Validate() error

Jump to

Keyboard shortcuts

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