addressassignment

package
v0.0.0-...-1c5d739 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 20

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 GetType

func GetType() string

GetType returns the type for AddressAssignment objects It returns the type as string

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) GetID

func (a *AddressAssignment) GetID() string

GetID returns an AddressAssignment's ID It returns the ID as a string

func (*AddressAssignment) GetType

func (a *AddressAssignment) GetType() string

GetType return the type for AddressAssignment objects It returns the type as a string

func (*AddressAssignment) ValidEntity

func (a *AddressAssignment) ValidEntity() error

ValidEntity used to make sure AddressAssignment is in a valid state

type AssignmentRequest

type AssignmentRequest struct {
	ServiceID      string
	IPAddress      string
	AutoAssignment bool
	Port           uint16
	Proto          string
	EndpointName   string
}

AssignmentRequest is used to couple a serviceId to an IPAddress

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, poolID string, ipAddr string, port uint16) (*AddressAssignment, error)

func (*Store) FindAssignmentByServiceEndpoint

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

func (*Store) GetAllAddressAssignments

func (s *Store) GetAllAddressAssignments(ctx datastore.Context) ([]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, poolID string, port uint16) ([]AddressAssignment, error)

Jump to

Keyboard shortcuts

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