Documentation ¶
Index ¶
- func FindBool(f finder, path string) (bool, error)
- func FindInt(f finder, path string) (int, error)
- func FindString(f finder, path string) (string, error)
- type ConnectEntry
- type ConnectionEnd
- type Document
- func (d Document) FindBool(path string) (bool, error)
- func (d Document) FindInt(path string) (int, error)
- func (d Document) FindString(path string) (string, error)
- func (d Document) MustBool(path string) bool
- func (d Document) MustInt(path string) int
- func (d Document) MustString(path string) string
- type K8SConfiguration
- type ListenEntry
- type MetaProperties
- type XConnect
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindString ¶ added in v0.13.0
FindString returns a string for a given slash path, e.g xconnect/connect/db/url .
Types ¶
type ConnectEntry ¶
type ConnectEntry struct { Protocol string `yaml:"protocol,omitempty" json:"scheme,omitempty"` Secure *bool `yaml:"secure,omitempty" json:"secure,omitempty"` Host string `yaml:"host,omitempty" json:"host,omitempty"` Port *int `yaml:"port,omitempty" json:"port,omitempty"` URL string `yaml:"url,omitempty" json:"url,omitempty"` Disabled bool `yaml:"disabled,omitempty" json:"disabled,omitempty"` Kind string `yaml:"kind,omitempty" json:"kind,omitempty"` // Resource is to identify the virtual listen part Resource string `yaml:"resource,omitempty" json:"resource,omitempty"` ExtraFields map[string]interface{} `yaml:"-,inline"` }
ConnectEntry is a list element in the xconnect.connect config.
func (ConnectEntry) NetworkID ¶ added in v0.8.2
func (e ConnectEntry) NetworkID() string
NetworkID returns URL or HOST:PORT
func (ConnectEntry) ResourceID ¶ added in v0.9.2
func (e ConnectEntry) ResourceID() string
ResourceID returns NetworkID() or KIND:RESOURCE
type ConnectionEnd ¶ added in v0.8.2
type ConnectionEnd interface {
NetworkID() string
}
type Document ¶
type Document struct { XConnect XConnect `yaml:"xconnect"` ExtraFields map[string]interface{} `yaml:"-,inline"` }
Document is the root YAML element
func GetConfig ¶ added in v0.11.0
GetConfig will first check the environment value at {envKey} to find the source of the confguration. If the environment value is not available (empty) then try reading the filename to get the configuration.
func LoadConfig ¶ added in v0.9.5
LoadConfig returns the document containing the xconnect section.
func (Document) FindInt ¶ added in v0.9.6
FindInt returns a integer for a given slash path, e.g xconnect/listen/api/port .
func (Document) FindString ¶ added in v0.9.3
FindString returns a string for a given slash path, e.g xconnect/connect/db/url .
func (Document) MustBool ¶ added in v0.12.0
MustBool same as FindBool but panics if not found. E.g xconnect/listen/api/secure
func (Document) MustInt ¶ added in v0.12.0
MustInt same as FindInt but panics if not found. E.g xconnect/listen/api/port
func (Document) MustString ¶ added in v0.12.0
MustString same as FindString but panics if not found. E.g xconnect/connect/db/url .
type K8SConfiguration ¶
type K8SConfiguration struct { APIVersion string `yaml:"apiVersion"` Data map[string]interface{} `yaml:"data"` Kind string `yaml:"kind" ` Metadata struct { Name string `yaml:"name" ` Namespace string `yaml:"namespace"` CreationTimestamp time.Time `yaml:"creationTimestamp"` } `yaml:"metadata"` }
K8SConfiguration represents a Kubernetes configuration.
func (K8SConfiguration) ExtractConfig ¶
func (k K8SConfiguration) ExtractConfig() (x XConnect, err error)
ExtractConfig expects a "xconnect" key in the data map and parses that part into a xconnect.Config.
type ListenEntry ¶
type ListenEntry struct { Protocol string `yaml:"protocol,omitempty" json:"scheme,omitempty"` Host string `yaml:"host,omitempty" json:"host,omitempty"` Port *int `yaml:"port,omitempty" json:"port,omitempty"` // for database connection strings URL string `yaml:"url,omitempty" json:"url,omitempty"` Secure *bool `yaml:"secure,omitempty" json:"secure,omitempty"` Disabled bool `yaml:"disabled,omitempty" json:"disabled,omitempty"` ExtraFields map[string]interface{} `yaml:"-,inline"` }
ListenEntry is a list element in the xconnect.accept config.
func (ListenEntry) NetworkID ¶ added in v0.8.2
func (e ListenEntry) NetworkID() string
type MetaProperties ¶ added in v0.9.5
type MetaProperties struct { Name string `yaml:"name,omitempty" json:"name,omitempty"` Version string `yaml:"version,omitempty" json:"version,omitempty"` // Operational expenditure, or owner Opex string `yaml:"opex,omitempty" json:"opex,omitempty"` Labels []string `yaml:"tags,omitempty" json:"tags,omitempty"` ExtraFields map[string]interface{} `yaml:"-,inline"` Kind string `yaml:"kind,omitempty" json:"kind,omitempty"` }
MetaProperties represents the meta element in the xconnect data section.
type XConnect ¶ added in v0.9.5
type XConnect struct { Meta MetaProperties `yaml:"meta" json:"meta"` Listen map[string]ListenEntry `yaml:"listen" json:"listen"` Connect map[string]ConnectEntry `yaml:"connect" json:"connect"` ExtraFields map[string]interface{} `yaml:"-,inline"` }
XConnect represents the xconnect data section of a YAML document. See spec-xconnect.yaml.