registry

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

options.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	ID       string            `json:"id"`
	Address  string            `json:"address"`
	Metadata map[string]string `json:"metadata"`
}

Node struct

type Option

type Option func(*Options)

Option func

func WithAddr

func WithAddr(address ...string) Option

WithAddr set address option

func WithContext

func WithContext(context context.Context) Option

WithContext set context option

func WithDebug

func WithDebug(debug bool) Option

WithDebug set debug option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout set timeout option

type Options

type Options struct {
	Address []string
	Timeout time.Duration
	Debug   bool
	Context context.Context
}

Options struct

type Registry

type Registry interface {
	Register(context.Context, *Service) error
	Deregister(context.Context, *Service) error
	GetService(context.Context, string) (*Service, error)
	String() string
}

Registry inferface

type Service

type Service struct {
	Name     string            `json:"name"`
	Nodes    []*Node           `json:"nodes"`
	Metadata map[string]string `json:"metadata"`
}

Service struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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