cloudmap

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package cloudmap contains code that connects to AWS Cloud Map and manages namespaces, services and instances (endpoints) inside it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Client cloudMapClientIface
	// contains filtered or unexported fields
}

Handler is in charge of handling all the operations that need to be performed in AWS Cloud Map.

func NewHandler

func NewHandler(ctx context.Context, client *servicediscovery.Client, log logr.Logger) *Handler

NewHandler returns a new instance of the Handler.

func (*Handler) CreateEndp

func (h *Handler) CreateEndp(endp *sr.Endpoint) (*sr.Endpoint, error)

CreateEndp creates the endpoint.

func (*Handler) CreateNs

func (h *Handler) CreateNs(ns *sr.Namespace) (*sr.Namespace, error)

CreateNs creates the namespace.

func (*Handler) CreateServ

func (h *Handler) CreateServ(serv *sr.Service) (*sr.Service, error)

CreateServ creates the service.

func (*Handler) DeleteEndp

func (h *Handler) DeleteEndp(nsName, servName, endpName string) error

DeleteEndp deletes the endpoint.

func (*Handler) DeleteNs

func (h *Handler) DeleteNs(name string) error

GetNs returns the namespace if exists.

func (*Handler) DeleteServ

func (h *Handler) DeleteServ(nsName, servName string) error

DeleteServ deletes the service.

func (*Handler) ExtractData

func (h *Handler) ExtractData(ns *corev1.Namespace, serv *corev1.Service) (*sr.Namespace, *sr.Service, []*sr.Endpoint, error)

func (*Handler) GetEndp

func (h *Handler) GetEndp(nsName, servName, endpName string) (*sr.Endpoint, error)

GetEndp returns the endpoint if exists.

func (*Handler) GetNs

func (h *Handler) GetNs(name string) (*sr.Namespace, error)

GetNs returns the namespace if exists.

func (*Handler) GetServ

func (h *Handler) GetServ(nsName, servName string) (*sr.Service, error)

GetServ returns the service if exists.

func (*Handler) ListEndp

func (h *Handler) ListEndp(nsName, servName string) (endpList []*sr.Endpoint, err error)

ListServ returns a list of services inside the provided namespace.

func (*Handler) ListNs

func (h *Handler) ListNs() (nsList []*sr.Namespace, err error)

ListNs returns a list of all namespaces.

func (*Handler) ListServ

func (h *Handler) ListServ(nsName string) (servList []*sr.Service, err error)

ListServ returns a list of services inside the provided namespace.

func (*Handler) UpdateEndp

func (h *Handler) UpdateEndp(endp *sr.Endpoint) (*sr.Endpoint, error)

UpdateEndp updates the endpoint.

func (*Handler) UpdateNs

func (h *Handler) UpdateNs(ns *sr.Namespace) (*sr.Namespace, error)

GetNs returns the namespace if exists.

func (*Handler) UpdateServ

func (h *Handler) UpdateServ(serv *sr.Service) (*sr.Service, error)

UpdateServ updates the service.

Jump to

Keyboard shortcuts

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