maestro

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: MIT Imports: 7 Imported by: 0

README

Maestro Go SDK

The Golang SDK for the Maestro Service Discovery API.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(baseUrl, token, id string, config *ClientConfig) *Client

func (*Client) Deregister

func (c *Client) Deregister() error

Deregister removes the service from the registry

func (*Client) Query

func (c *Client) Query(id string) (Registrant, error)

Query queries Maestro for the info on the specified ID

func (*Client) Register

func (c *Client) Register(address string) error

Register registered the service combined with the given public address with the registry

func (*Client) StartPing

func (c *Client) StartPing(ctx context.Context, interval time.Duration)

StartPing pings the Maestro instance at the supplied interval. Should be started as a goroutine. Can be stopped via the context's Cancel function.

type ClientConfig

type ClientConfig struct {
	Timeout   time.Duration
	Transport *http.Transport
}

type Registrant

type Registrant struct {
	Id      string `json:"id"`
	Address string `json:"address"`
}

type Route

type Route string

Jump to

Keyboard shortcuts

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