awssd

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 13 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(ctx context.Context, params *sd.CreateServiceInput, optFns ...func(*sd.Options)) (*sd.CreateServiceOutput, error)
	DeregisterInstance(ctx context.Context, params *sd.DeregisterInstanceInput, optFns ...func(*sd.Options)) (*sd.DeregisterInstanceOutput, error)
	DiscoverInstances(ctx context.Context, params *sd.DiscoverInstancesInput, optFns ...func(*sd.Options)) (*sd.DiscoverInstancesOutput, error)
	ListNamespaces(ctx context.Context, params *sd.ListNamespacesInput, optFns ...func(*sd.Options)) (*sd.ListNamespacesOutput, error)
	ListServices(ctx context.Context, params *sd.ListServicesInput, optFns ...func(*sd.Options)) (*sd.ListServicesOutput, error)
	RegisterInstance(ctx context.Context, params *sd.RegisterInstanceInput, optFns ...func(*sd.Options)) (*sd.RegisterInstanceOutput, error)
	UpdateService(ctx context.Context, params *sd.UpdateServiceInput, optFns ...func(*sd.Options)) (*sd.UpdateServiceOutput, error)
	DeleteService(ctx context.Context, params *sd.DeleteServiceInput, optFns ...func(*sd.Options)) (*sd.DeleteServiceOutput, 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://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/servicediscovery

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, dryRun, cleanEmptyService bool, ownerID string, tags map[string]string, client AWSSDClient) (*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(ctx context.Context, namespaceID *string, srvName *string, ep *endpoint.Endpoint) (*sdtypes.Service, error)

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

func (*AWSSDProvider) DeleteService added in v0.11.1

func (p *AWSSDProvider) DeleteService(ctx context.Context, service *sdtypes.Service) error

DeleteService deletes empty Service from AWS API if its owner id match

func (*AWSSDProvider) DeregisterInstance

func (p *AWSSDProvider) DeregisterInstance(ctx context.Context, service *sdtypes.Service, ep *endpoint.Endpoint) error

DeregisterInstance removes an instance from given service.

func (*AWSSDProvider) ListNamespaces

func (p *AWSSDProvider) ListNamespaces(ctx context.Context) ([]*sdtypes.NamespaceSummary, error)

ListNamespaces returns all namespaces matching defined namespace filter

func (*AWSSDProvider) ListServicesByNamespaceID

func (p *AWSSDProvider) ListServicesByNamespaceID(ctx context.Context, namespaceID *string) (map[string]*sdtypes.Service, error)

ListServicesByNamespaceID returns list of services in given namespace.

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(ctx context.Context, service *sdtypes.Service, ep *endpoint.Endpoint) error

RegisterInstance creates a new instance in given service.

func (*AWSSDProvider) UpdateService

func (p *AWSSDProvider) UpdateService(ctx context.Context, service *sdtypes.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