admin

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is an admin tools service e.g for registering and deregistering micro-services

func NewService

func NewService(ext extension.BaseExtension) *Service

NewService returns admin service

func (Service) CheckHealthEndpoint

func (s Service) CheckHealthEndpoint(ctx context.Context, healthEndpoint string) bool

CheckHealthEndpoint Check if service is reachable

func (*Service) CheckPreconditions

func (s *Service) CheckPreconditions()

CheckPreconditions ...

func (*Service) DeregisterAllMicroservices

func (s *Service) DeregisterAllMicroservices(ctx context.Context) (bool, error)

DeregisterAllMicroservices removes all services at once. This is called internally when running in CLI mode

func (*Service) DeregisterMicroservice

func (s *Service) DeregisterMicroservice(ctx context.Context, id string) (bool, error)

DeregisterMicroservice removes a micro-service

func (*Service) FindMicroserviceByID

func (s *Service) FindMicroserviceByID(ctx context.Context, id string) (*domain.Microservice, error)

FindMicroserviceByID retrieves a micro-service by it's ID

func (*Service) ListMicroservices

func (s *Service) ListMicroservices(ctx context.Context) ([]*domain.Microservice, error)

ListMicroservices returns all registered micro-services

func (*Service) PollMicroservicesStatus

func (s *Service) PollMicroservicesStatus(ctx context.Context) ([]*domain.MicroserviceStatus, error)

PollMicroservicesStatus checks if the registered microservices are serving HTTP requests/ healthy

func (*Service) RegisterMicroservice

func (s *Service) RegisterMicroservice(
	ctx context.Context,
	input domain.Microservice,
) (*domain.Microservice, error)

RegisterMicroservice registers a micro-service

type Usecase

type Usecase interface {
	RegisterMicroservice(
		ctx context.Context,
		input domain.Microservice,
	) (*domain.Microservice, error)
	ListMicroservices(ctx context.Context) ([]*domain.Microservice, error)
	DeregisterMicroservice(ctx context.Context, id string) (bool, error)
	DeregisterAllMicroservices(ctx context.Context) (bool, error)
	FindMicroserviceByID(ctx context.Context, id string) (*domain.Microservice, error)
	PollMicroservicesStatus(ctx context.Context) ([]*domain.MicroserviceStatus, error)
}

Usecase ...

Jump to

Keyboard shortcuts

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