model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ipv4Attr = "AWS_INSTANCE_IPV4"
	PortAttr = "AWS_INSTANCE_PORT"
)

Variables

This section is empty.

Functions

func EndpointIdFromIPAddress

func EndpointIdFromIPAddress(address string) string

EndpointIdFromIPAddress converts an IP address to human readable identifier.

Types

type Changes

type Changes struct {
	// List of endpoints that need to be created
	Create []*Endpoint
	// List of endpoints that need to be updated
	Update []*Endpoint
	// List of endpoints that need to be deleted
	Delete []*Endpoint
}

type Endpoint

type Endpoint struct {
	Id         string
	IP         string
	Port       int32
	Attributes map[string]string
}

Endpoint holds basic values and attributes for an endpoint.

func NewEndpointFromInstance

func NewEndpointFromInstance(inst *types.InstanceSummary) (*Endpoint, error)

NewEndpointFromInstance converts a Cloud Map InstanceSummary to an endpoint.

func (*Endpoint) Equals

func (e *Endpoint) Equals(other *Endpoint) bool

Equals evaluates if two Endpoints are "deeply equal" (including all fields).

func (*Endpoint) GetCloudMapAttributes added in v0.1.1

func (e *Endpoint) GetCloudMapAttributes() map[string]string

GetCloudMapAttributes extracts endpoint attributes for Cloud Map service instance registration.

func (*Endpoint) String

func (e *Endpoint) String() string

String gives a string representation for an endpoint.

type Namespace added in v0.1.1

type Namespace struct {
	Id   string
	Name string
	Type NamespaceType
}

Namespace hold namespace attributes

type NamespaceType added in v0.1.1

type NamespaceType string
const (
	HttpNamespaceType       NamespaceType = "HTTP"
	DnsPrivateNamespaceType NamespaceType = "DNS_PRIVATE"
	// UnsupportedNamespaceType Placeholder NamespaceType to denote not supported values
	UnsupportedNamespaceType NamespaceType = ""
)

func ConvertNamespaceType added in v0.1.1

func ConvertNamespaceType(nsType types.NamespaceType) (namespaceType NamespaceType)

func (*NamespaceType) IsUnsupported added in v0.1.1

func (namespaceType *NamespaceType) IsUnsupported() bool

type Plan

type Plan struct {
	// List of current instances
	Current []*Endpoint

	// List of desired instances
	Desired []*Endpoint
}

func (*Plan) CalculateChanges

func (p *Plan) CalculateChanges() Changes

CalculateChanges returns list of Changes that need to applied

type Resource added in v0.1.1

type Resource struct {
	Id   string
	Name string
}

Resource encapsulates a ID/name pair.

type Service

type Service struct {
	Namespace string
	Name      string
	Endpoints []*Endpoint
}

Service holds namespace and endpoint state for a named service.

Jump to

Keyboard shortcuts

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