service

package
v0.0.0-...-f2cd14d Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2016 License: GPL-3.0 Imports: 9 Imported by: 3

Documentation

Overview

Core service infrastructure for servicing starting/stopping/SIGTERM, and heartbeating etc

Index

Constants

View Source
const (
	// DefaultMessageBusURL is the default MessageBus URL for service communications.
	DefaultMessageBusURL = messagebus.DefaultUrl
	// DefaultHeartbeatFreq is the period between service heartbeats in seconds.
	DefaultHeartbeatFreq = int(3)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MessageBusURL string `json:"service_message_bus"`
	ServiceName   string `json:"service_name"`
	HeartbeatFreq int    `json:"service_heartbeat_freq"`
}

Config represents the configuration for base service.

func NewConfig

func NewConfig() Config

NewConfig returns an instance of Config with defaults.

type Service

type Service struct {
	Config Config
	Status proto.Heartbeat_Status
	// contains filtered or unexported fields
}

func NewService

func NewService(c Config) *Service

func (*Service) Start

func (self *Service) Start() chan bool

func (*Service) Stop

func (self *Service) Stop()

Jump to

Keyboard shortcuts

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