service

package
v0.0.0-...-6a16b6f Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSchema

func BuildSchema(s Service, scriptPath string) error

func NewMessage

func NewMessage(origin Service) *message

func NewSType

func NewSType(name string, cTor ServiceCtor, ex bool) error

func Schema

func Schema(s Service) string

returns string name of the schema associated with a service

func SchemaExists

func SchemaExists(s Service) (bool, error)

checks if a Database Already exists

func StartSysService

func StartSysService(logger *log.Logger, sysName string)

Types

type AbstractService

type AbstractService struct {
	Log *log.Logger
	// contains filtered or unexported fields
}

func NewAbstractService

func NewAbstractService(name string, id int64, logger *log.Logger) *AbstractService

func (*AbstractService) ID

func (s *AbstractService) ID() int64

func (*AbstractService) Name

func (s *AbstractService) Name() string

type DuplicateIDError

type DuplicateIDError error

type DuplicateTypeError

type DuplicateTypeError error

type InitializationError

type InitializationError error

type InvalidServiceError

type InvalidServiceError error

type InvalidTypeError

type InvalidTypeError error

type Service

type Service interface {
	//Setup should perform first time setup routines for the Service such as creating database tables
	Setup() error

	//Init runs once at the Registration of the Service. acts like a secondary constructor
	Init() error
	Start() error
	Stop()

	Name() string
	ID() int64
	// contains filtered or unexported methods
}

func NewService

func NewService(typ string, id int64, name string) (Service, error)

type ServiceCtor

type ServiceCtor func(id int64, name string, logger *log.Logger) Service

type Status

type Status struct {
}

type SysService

type SysService struct {
	AbstractService
	// contains filtered or unexported fields
}

func (*SysService) Init

func (s *SysService) Init() error

func (*SysService) Running

func (s *SysService) Running() bool

func (*SysService) Setup

func (s *SysService) Setup() error

func (*SysService) Start

func (s *SysService) Start() error

func (*SysService) Stop

func (s *SysService) Stop()

Jump to

Keyboard shortcuts

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