servicediscovery

package module
v0.0.0-...-6377813 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

README

servicediscovery

A service discovery micro framework ontop of DynamoDB.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceDiscovery

type ServiceDiscovery interface {
	// RegisterWorker or re-register worker with a heartBeat timestamp that proves the worker is alive and well.
	RegisterWorker(worker ServiceWorker, heartBeatTime time.Time) error
	// ListWorkers for a ServiceRole, earliestLastSeen is used to filter out workers that haven't hearbeat after said time
	ListWorkers(service ServiceRole, earliestLastSeen time.Time) ([]*ServiceWorker, error)
}

ServiceDiscovery allows us to find workers for a serviceRole and also to register a worker that belongs to a serviceRole

type ServiceRole

type ServiceRole struct {
	ServiceName string // name of the service this server belongs to (FooService)
	Role        string // role of this server, ie: apiserver, adminserver, worker
	DeployGroup string // many deployments, ie: dev, prod-us, prod-eu, etc..
}

ServiceRole specifies a service we run on a specific deployment unit

func (*ServiceRole) ServiceId

func (svc *ServiceRole) ServiceId() string

type ServiceWorker

type ServiceWorker struct {
	Service  ServiceRole
	WorkerId string
	LastSeen time.Time
	Endpoint string
}

ServiceWorker is an instance that runs a given service

Directories

Path Synopsis
package dynamodb implements ServiceDiscovery interface using dynamodb tables.
package dynamodb implements ServiceDiscovery interface using dynamodb tables.
inmemory implements a in memory only service discovery
inmemory implements a in memory only service discovery

Jump to

Keyboard shortcuts

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