addressassignment

package
v0.0.0-...-88aa921 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//MAPPING is the elastic mapping for an address assignment
	MAPPING, _ = elastic.NewMapping(mappingString)
)

Functions

func Key

func Key(id string) datastore.Key

Key creates a Key suitable for getting, putting and deleting AddressAssignment

Types

type AddressAssignment

type AddressAssignment struct {
	ID             string //Generated id
	AssignmentType string //static or virtual
	HostID         string //Host id if type is static
	PoolID         string //Pool id if type is virtual
	IPAddr         string //Used to associate to resource in Pool or Host
	Port           uint16 //Actual assigned port
	ServiceID      string //Service using this assignment
	EndpointName   string //Endpoint in the service using the assignment
	datastore.VersionedEntity
}

AddressAssignment is used to track Ports that have been assigned to a Service.

func (AddressAssignment) EqualIP

func (assign AddressAssignment) EqualIP(b AddressAssignment) bool

EqualIP verifies the address assignment is the same by IP ONLY

func (*AddressAssignment) ValidEntity

func (a *AddressAssignment) ValidEntity() error

ValidEntity used to make sure AddressAssignment is in a valid state

type Store

type Store struct {
	datastore.DataStore
}

Store type for interacting with AddressAssignment persistent storage

func NewStore

func NewStore() *Store

NewStore creates a AddressAssignmentStore store

func (*Store) FindAssignmentByHostPort

func (s *Store) FindAssignmentByHostPort(ctx datastore.Context, ipAddr string, port uint16) (*AddressAssignment, error)

func (*Store) FindAssignmentByServiceEndpoint

func (s *Store) FindAssignmentByServiceEndpoint(ctx datastore.Context, serviceID, endpointName string) (*AddressAssignment, error)

func (*Store) GetServiceAddressAssignments

func (s *Store) GetServiceAddressAssignments(ctx datastore.Context, serviceID string) ([]AddressAssignment, error)

func (*Store) GetServiceAddressAssignmentsByPort

func (s *Store) GetServiceAddressAssignmentsByPort(ctx datastore.Context, port uint16) ([]AddressAssignment, error)

Jump to

Keyboard shortcuts

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