awssd

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSSDClient

type AWSSDClient interface {
	CreateService(input *sd.CreateServiceInput) (*sd.CreateServiceOutput, error)
	DeregisterInstance(input *sd.DeregisterInstanceInput) (*sd.DeregisterInstanceOutput, error)
	GetService(input *sd.GetServiceInput) (*sd.GetServiceOutput, error)
	ListInstancesPages(input *sd.ListInstancesInput, fn func(*sd.ListInstancesOutput, bool) bool) error
	ListNamespacesPages(input *sd.ListNamespacesInput, fn func(*sd.ListNamespacesOutput, bool) bool) error
	ListServicesPages(input *sd.ListServicesInput, fn func(*sd.ListServicesOutput, bool) bool) error
	RegisterInstance(input *sd.RegisterInstanceInput) (*sd.RegisterInstanceOutput, error)
	UpdateService(input *sd.UpdateServiceInput) (*sd.UpdateServiceOutput, error)
}

AWSSDClient is the subset of the AWS Cloud Map API that we actually use. Add methods as required. Signatures must match exactly. Taken from https://github.com/aws/aws-sdk-go/blob/HEAD/service/servicediscovery/api.go

type AWSSDProvider

type AWSSDProvider struct {
	provider.BaseProvider
	// contains filtered or unexported fields
}

AWSSDProvider is an implementation of Provider for AWS Cloud Map.

func NewAWSSDProvider

func NewAWSSDProvider(domainFilter endpoint.DomainFilter, namespaceType string, assumeRole string, dryRun bool) (*AWSSDProvider, error)

NewAWSSDProvider initializes a new AWS Cloud Map based Provider.

func (*AWSSDProvider) ApplyChanges

func (p *AWSSDProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error

ApplyChanges applies Kubernetes changes in endpoints to AWS API

func (*AWSSDProvider) CreateService

func (p *AWSSDProvider) CreateService(namespaceID *string, srvName *string, ep *endpoint.Endpoint) (*sd.Service, error)

CreateService creates a new service in AWS API. Returns the created service.

func (*AWSSDProvider) DeregisterInstance

func (p *AWSSDProvider) DeregisterInstance(service *sd.Service, ep *endpoint.Endpoint) error

DeregisterInstance removes an instance from given service.

func (*AWSSDProvider) GetServiceDetail

func (p *AWSSDProvider) GetServiceDetail(serviceID *string) (*sd.Service, error)

GetServiceDetail returns detail of given service

func (*AWSSDProvider) ListInstancesByServiceID

func (p *AWSSDProvider) ListInstancesByServiceID(serviceID *string) ([]*sd.InstanceSummary, error)

ListInstancesByServiceID returns list of instances registered in given service.

func (*AWSSDProvider) ListNamespaces

func (p *AWSSDProvider) ListNamespaces() ([]*sd.NamespaceSummary, error)

ListNamespaces returns all namespaces matching defined namespace filter

func (*AWSSDProvider) ListServicesByNamespaceID

func (p *AWSSDProvider) ListServicesByNamespaceID(namespaceID *string) (map[string]*sd.Service, error)

ListServicesByNamespaceID returns list of services in given namespace. Returns map[srv_name]*sd.Service

func (*AWSSDProvider) Records

func (p *AWSSDProvider) Records(ctx context.Context) (endpoints []*endpoint.Endpoint, err error)

Records returns list of all endpoints.

func (*AWSSDProvider) RegisterInstance

func (p *AWSSDProvider) RegisterInstance(service *sd.Service, ep *endpoint.Endpoint) error

RegisterInstance creates a new instance in given service.

func (*AWSSDProvider) UpdateService

func (p *AWSSDProvider) UpdateService(service *sd.Service, ep *endpoint.Endpoint) error

UpdateService updates the specified service with information from provided endpoint.

Jump to

Keyboard shortcuts

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