source

package
v0.0.0-...-a61cce2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Kv : BackendType key value represents any key value storage
	Kv = iota
	// Db : BackendType database represents any database other than key value storage
	Db
)
View Source
const (
	Env = iota
	Metadata
	Store
)

Variables

View Source
var (
	// Pattern : the pattern of the path
	//
	// ex:
	// vault+https://cluster01.company.internal/v1.1/company/team10/kv/peroject_01/stg/environment
	// <source>://<host>/<version>/<namespace>/<type>/<service>/<env>/<path>
	// default://
	//
	// <version>/<namespace>/<type>/<service>/<env>/<path>
	//
	// alias+staging://environment
	// alias+<alias-name>://<path>
	//
	Pattern = regexp.MustCompile("^v([\\w\\.]+)\\/(.*)\\/(kv|db)+\\/(.*)\\/(stg|prod|canary|test|local)\\/(.*)")
)

Functions

func LookupPathIncomplete

func LookupPathIncomplete(path string) error

func RegisterSource

func RegisterSource(name string, factory SourceFactory)

func UnsupportedLookupPath

func UnsupportedLookupPath(path string) error

Types

type Backend

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

func BackendOf

func BackendOf(str string) Backend

type BackendType

type BackendType int

BackendType newtype that represents backend type in the path ex: kv or db

type Credentials

type Credentials map[string]base.StringList

type DynamicSource

type DynamicSource interface {
	Source
	Replace(source *Source)
}

type LookupPath

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

LookupPath : Represents the actual path of given source declaration

func ParseLookupPath

func ParseLookupPath(path string) (LookupPath, error)

type Namespace

type Namespace string

Namespace newtype that represents namespace identifier in the path

type OptionArgs

type OptionArgs map[string]interface{}

type ServicePath

type ServicePath Subpath

ServicePath newtype that represents service identifier in path

type Source

type Source interface {
	SLookup(path string) (string, error)
	ALookup(path string) (base.AbstractArray, error)
	HLookup(path string) (base.AbstractMap, error)
	Close()
}

type SourceFactory

type SourceFactory (func(uri md.LimitedURI, credential Credentials, options OptionArgs) (Source, error))

SourceFactory : Factory for source

type SourceIdentifier

type SourceIdentifier interface {
	Pattern() *regexp.Regexp
	Path(path string) (string, error)
}

type SourceRegistry

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

func Registry

func Registry(sources map[string]md.LimitedURI) (SourceRegistry, []error)

func (SourceRegistry) IsEmpty

func (r SourceRegistry) IsEmpty() bool

func (SourceRegistry) Size

func (r SourceRegistry) Size() int

func (SourceRegistry) Source

func (r SourceRegistry) Source(name string) (Source, bool)

Source : Get source from source registry

type SourceType

type SourceType int

type Sources

type Sources map[string]Source

func (Sources) Close

func (ss Sources) Close()

type StaticSource

type StaticSource map[string]interface{}

Static source

type Subpath

type Subpath []string

Subpath newtype

Directories

Path Synopsis
aws
ssm

Jump to

Keyboard shortcuts

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