connect

package
v0.0.0-...-dd2ee09 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResolver

func NewResolver(client HealthAPI, service string, opts ...ResolverOption) naming.Resolver

Types

type AgentAPI

type AgentAPI interface {
	ServiceRegister(ctx context.Context, registration consulapi.AgentServiceRegistration) error
	ServiceDeregister(ctx context.Context, serviceID string) error
	UpdateTTL(ctx context.Context, status consulapi.Status, checkID, output string) error
}

type HealthAPI

type HealthAPI interface {
	Connect(ctx context.Context, service string, passing bool) ([]consulapi.HealthServiceEntry, error)
}

type ResolverOption

type ResolverOption func(*resolverOptions)

func WithDebug

func WithDebug(debugf func(format string, args ...interface{})) ResolverOption

func WithLogger

func WithLogger(logf func(format string, args ...interface{})) ResolverOption

type Service

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

func NewService

func NewService(agent AgentAPI, service string, port int, opts ...ServiceOption) (*Service, error)

func (*Service) Close

func (s *Service) Close() error

type ServiceOption

type ServiceOption func(*serviceOptions)

func WithHealthCheckFunc

func WithHealthCheckFunc(fn func() error) ServiceOption

func WithHealthCheckInterval

func WithHealthCheckInterval(interval time.Duration) ServiceOption

Jump to

Keyboard shortcuts

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