schema

package
v0.0.0-...-3c02646 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// encoding problems
	DiagEncryptionKeyEncoding       = "The encryption key provided is not base64 encoded"
	DiagEncryptionKeyEncodingDetail = "Encryption keys must be base64 encoded to prevent the need for escaping when passing the key in via" +
		"environment variables and/or config files."

	// length problems
	DiagEncryptionKeyBelowLength  = "The encryption key provided is less than 32 bytes in length"
	DiagEncryptionKeyAboveLength  = "The encryption key provided is more than 32 bytes in length"
	DiagEncryptionKeyLengthDetail = "Encryption keys must be exactly 32 bytes in length to enable the encryption algorithm. You can use" +
		"the 'response keygen' command to generate a suitable encryption key."

	// Bytes required for AES 256-bit encryption algorithm
	EncryptionByteRequirement = 32
)

Problem messages, use for comparison if necessary.

View Source
const (
	DiagUnsupportedAutoJoinType = "Unsupported cluster auto-join type"
)

Public diagnostic summaries

View Source
const (
	DiagUnsupportedDatabaseDriver = "Unsupported database driver"
)

Public diagnostic summaries

Variables

View Source
var (
	// Diagnostic messages regarding an invalid message bus implementation type
	DiagInvalidPubSubType       = "The events type is not valid"
	DiagInvalidPubSubTypeDetail = "The events type must be one of: embedded, nats"

	DiagNATSRequiresURL       = "The 'nats' events type requires a URL."
	DiagNatsRequiresURLDetail = "You must provide the 'url' attribute when using the 'nats' pubsub type."
)

Diag messages

Functions

func ClusterDefinition

func ClusterDefinition() parser.NamedBlockDefinition

func DatabaseDefinition

func DatabaseDefinition() parser.NamedBlockDefinition

DatabaseDefinition allows registration of the database block using NewWithSubset.

func DeveloperDefinition

func DeveloperDefinition() parser.NamedBlockDefinition

func EncryptionKeyDefinition

func EncryptionKeyDefinition() parser.NamedBlockDefinition

EncryptionKeyDefinition allows registration of the encryption_key definition block using NewWithSubset.

func EventsDefinition

func EventsDefinition() parser.NamedBlockDefinition

EventsDefinition allows registration of the events block using NewWithSubset.

func NewContext

func NewContext() *hcl.EvalContext

NewContext creates a new hcl.EvalContext and returns the pointer to be used with the schema. This allows the caller to automatically insert expected functions and variables.

func Schema

Schema defines the blocks and their respecify BlockDefinition by creating an instance of parser.BlockDefinitions.

func VariablesDefinition

func VariablesDefinition() parser.NamedBlockDefinition

VariablesDefinition allows registration of the vars definition block using NewWithSubset.

Types

type IPGetter

type IPGetter struct{}

IPGetter implements the PrivateIPGetter, PublicIPGetter, and InterfaceIPGetter interfaces used by the networking functions to return proper addresses for listener bindings.

func (*IPGetter) GetInterfaceIP

func (g *IPGetter) GetInterfaceIP(namedIf string) (string, error)

GetInterfaceIP returns a string with a single IP address sorted by the size of the network (i.e. IP addresses with a smaller netmask, larger network size, are sorted first). This function is the `eval` equivalent of:

func (*IPGetter) GetPrivateIP

func (g *IPGetter) GetPrivateIP() (string, error)

GetPrivateIP returns a string with a single IP address that is part of RFC 6890 and has a default route. If the system can't determine its IP address or find an RFC 6890 IP address, an empty string will be returned instead.

func (*IPGetter) GetPublicIP

func (g *IPGetter) GetPublicIP() (string, error)

GetPublicIP returns a string with a single IP address that is NOT part of RFC 6890 and has a default route. If the system can't determine its IP address or find a non RFC 6890 IP address, an empty string will be returned instead.

type InterfaceIPGetter

type InterfaceIPGetter interface {
	GetInterfaceIP(namedIf string) (string, error)
}

InterfaceIPGetter implements a function that returns the current IP address for the named interface provided.

type PrivateIPGetter

type PrivateIPGetter interface {
	GetPrivateIP() (string, error)
}

PrivateIPGetter implements a function that returns the current private IP address for the runtime environment.

type PublicIPGetter

type PublicIPGetter interface {
	GetPublicIP() (string, error)
}

PublicIPGetter implements a function that returns the current public IP address for the runtime environment.

Jump to

Keyboard shortcuts

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