service

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

func Context

func Context(ctx context.Context) Option

Context specifies a context for the service. Can be used to signal shutdown of the service. Can be used for extra option values.

func RegisterInterval

func RegisterInterval(t time.Duration) Option

func Server

func Server(s server.Server) Option

type Options

type Options struct {
	Server server.Server

	// Register loop interval
	RegisterInterval time.Duration

	// Other options for implementations of the interface
	// can be stored in a context
	Context context.Context
}

type Service

type Service interface {
	Init(...Option)
	Options() Options
	Server() server.Server
	Run() error
	String() string
}

func NewService

func NewService(opts ...Option) Service

Jump to

Keyboard shortcuts

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