penny

package module
v0.0.0-...-acbadc7 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2014 License: Apache-2.0 Imports: 18 Imported by: 0

README

penny

go & lua server

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Machines []string
	Log      string
	Addr     string
}

config for dock.

func ParseConfig

func ParseConfig(file string) *Config

parse toml file and return dock config.

type Dock

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

func NewDock

func NewDock(conf *Config) (*Dock, error)

func Run

func Run(path string) *Dock

start the default dock. path is the config file.

func (*Dock) AddService

func (d *Dock) AddService(name string, t reflect.Type, mqlen, instance_num int)

TODO two suggested length is two verbose.

func (*Dock) Dispatch

func (d *Dock) Dispatch()

func (*Dock) GetRemotes

func (d *Dock) GetRemotes() map[string]Remote

type Entry

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

type Remote

type Remote struct {
	Addr string `json:"Addr"`
	// contains filtered or unexported fields
}

type Service

type Service interface {
	Name() string
	Init() error
	Call(m proto.Msg) error
	Close() error
}

any service should implement this interface.

type Slog

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

func (*Slog) Call

func (s *Slog) Call(m proto.Msg) error

func (*Slog) Close

func (s *Slog) Close() error

func (*Slog) Init

func (s *Slog) Init() error

func (*Slog) Name

func (s *Slog) Name() string

type Slua

type Slua struct {
	L *lua.State
}

func (*Slua) Call

func (s *Slua) Call(m proto.Msg) error

func (*Slua) Close

func (s *Slua) Close() error

func (*Slua) Init

func (s *Slua) Init() error

func (*Slua) Name

func (s *Slua) Name() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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