consuls

package
v0.0.0-...-6df56f3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test()

Types

type AuthType

type AuthType string
const (
	HTTPAuthType AuthType = "http"
)

type BaseClient

type BaseClient struct {
	Conf *api.Config
}

func (*BaseClient) ReadKV

func (c *BaseClient) ReadKV(path string, opts *api.QueryOptions) (*api.KVPair, error)

func (*BaseClient) ReadKVAsVal

func (c *BaseClient) ReadKVAsVal(path string, opts *api.QueryOptions) (*ConsulPayload, error)

type Client

type Client interface {
	ReadKV(path string, opts *api.QueryOptions) (*api.KVPair, error)
	ReadKVAsVal(path string, opts *api.QueryOptions) (*ConsulPayload, error)
}

func NewClient

func NewClient(addr string, port int) Client

type ConsulPayload

type ConsulPayload struct {
	Pair  *api.KVPair
	AsVal cty.Value
}

type HTTPAuth

type HTTPAuth struct {
	Address string `yaml:"address"`
	Port    int    `yaml:"port"`
}

type KVInfo

type KVInfo struct {
	Path          string     `yaml:"key"`
	ValueJsonPath string     `yaml:"valPath"`
	Opts          *QueryOpts `yaml:"options"`
}

type QueryOpts

type QueryOpts struct {
	Namespace  string `yaml:"namespace"`
	Partition  string `yaml:"partition"`
	Datacenter string `yaml:"datacenter"`
}

type SourceInput

type SourceInput struct {
	ConsulAuthType AuthType  `yaml:"authType"`
	HttpAuth       *HTTPAuth `yaml:"-"`
	KV             KVInfo    `yaml:"value"`
}

func (*SourceInput) UnmarshalYAML

func (s *SourceInput) UnmarshalYAML(n *yaml.Node) error

Jump to

Keyboard shortcuts

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