service

package
v0.0.0-...-4d4bbb7 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: MIT 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)

Option func

func ServerAddress

func ServerAddress(address string) Option

ServerAddress set service server address.

func ServerName

func ServerName(name string) Option

ServerName set service server name.

func ServerOption

func ServerOption(opts ...grpc.ServerOption) Option

ServerOption set grpc server options.

func ServerProxy

func ServerProxy(enabled bool) Option

ServerProxy set grpc gateway proxy enabled or not.

func ServerProxyAddress

func ServerProxyAddress(address string) Option

ServerProxyAddress set grpc gateway proxy address.

type Options

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

Options holds service options

func (*Options) Database

func (o *Options) Database() database.Options

Database return database options

func (*Options) Init

func (o *Options) Init() error

Init initialize the service by parse the command line flag and initialize service dependencies eg: server and database.

func (*Options) Run

func (o *Options) Run() error

Run run the service.

func (*Options) Server

func (o *Options) Server() server.Options

Server returns server options

type Service

type Service interface {
	Init() error
	Database() database.Options
	Server() server.Options
	Run() error
}

Service service abstrations

func NewService

func NewService(opts ...Option) Service

NewService create new service instance

Jump to

Keyboard shortcuts

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