gotrade: github.com/cyanly/gotrade/core/service Index | Files

package service

import "github.com/cyanly/gotrade/core/service"

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

Index

Package Files

config.go init.go service.go

Constants

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)
)

type Config Uses

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 Uses

func NewConfig() Config

NewConfig returns an instance of Config with defaults.

type Service Uses

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

func NewService Uses

func NewService(c Config) *Service

func (*Service) Start Uses

func (self *Service) Start() chan bool

func (*Service) Stop Uses

func (self *Service) Stop()

Package service imports 9 packages (graph). Updated 2016-07-20. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).