nametemplate

package
v0.0.0-...-615a20d Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NameTemplate

type NameTemplate struct {

	// Element is a map of element name :: index in the segmented record name for the named element
	Element map[string]int
	// contains filtered or unexported fields
}

TODO: possibly need to store length of segmented format to handle cases

      where query string segments to a shorter or longer list than the template.
		 When query string segments to shorter than template:
			* either wildcards are being used, or
			* we are not looking up an A, AAAA, or SRV record (eg NS), or
			* we can just short-circuit failure before hitting the k8s API.
		 Where the query string is longer than the template, need to define which
		 symbol consumes the other segments. Most likely this would be the servicename.
		 Also consider how to handle static strings in the format template.

func (*NameTemplate) GetNamespaceFromSegmentArray

func (t *NameTemplate) GetNamespaceFromSegmentArray(segments []string) string

func (*NameTemplate) GetRecordNameFromNameValues

func (t *NameTemplate) GetRecordNameFromNameValues(values NameValues) string

GetRecordNameFromNameValues returns the string produced by applying the values to the NameTemplate format string.

func (*NameTemplate) GetServiceFromSegmentArray

func (t *NameTemplate) GetServiceFromSegmentArray(segments []string) string

func (*NameTemplate) GetSymbolFromSegmentArray

func (t *NameTemplate) GetSymbolFromSegmentArray(symbol string, segments []string) string

func (*NameTemplate) GetTypeFromSegmentArray

func (t *NameTemplate) GetTypeFromSegmentArray(segments []string) string

func (*NameTemplate) GetZoneFromSegmentArray

func (t *NameTemplate) GetZoneFromSegmentArray(segments []string) string

func (*NameTemplate) IsValid

func (t *NameTemplate) IsValid() bool

func (*NameTemplate) SetTemplate

func (t *NameTemplate) SetTemplate(s string) error

type NameValues

type NameValues struct {
	ServiceName string
	Namespace   string
	TypeName    string
	Zone        string
}

Jump to

Keyboard shortcuts

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