foundation

package
v0.0.0-...-73856a8 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version defines the version of a service (visible in Sentry, logs, etc).
	// It is changed at build time by the compiler to the commit used.
	Version = "dev"
)

Functions

This section is empty.

Types

type Server

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

func Init

func Init(name string) *Server

Init sets up and returns a server we can register a service with.

func NewServer

func NewServer(name string) *Server

func (*Server) ID

func (s *Server) ID() string

ID returns the worker ID of this service, derived from hostname.

func (*Server) Name

func (s *Server) Name() string

Name returns the name of this service, e.g. service.foo

func (*Server) Run

func (s *Server) Run(svc typhon.Service)

Run runs a service with typhon, handling shutdown gracefully.

func (*Server) Start

func (s *Server) Start(svc typhon.Service) error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context)

func (*Server) Version

func (s *Server) Version() string

Version returns the version of this service, set at compile time from git.

Jump to

Keyboard shortcuts

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