beacons

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

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

Go to latest
Published: May 4, 2014 License: MIT Imports: 17 Imported by: 0

README

Beacons

Build Status

Beacons is a application that handling and passing data between systems, scripted by Lua and written in Golang.

Dependency

Installing

All useful scripts were put at the directory shell.

Befor building, the proper lua librarie must be installed. E.g. Ubuntu 14.04, it is liblua5.1-0-dev.

Then:

go get github.com/mikespook/beacons/beacons

The beacons library can be embeded into other projects.

go get github.com/mikespook/beacons

Have a fun!

Usage

Service

Executing following command:

$ ${fullpath}/beacons -h

Some help information:

Usage of ./beacons:
	-config="config.json": Configration file

Scripting

Beacons uses Lua as the scripting language. Beacons will pass the log data into a Lua script for handling and passing to next.

Authors

Open Source

See LICENSE for more information.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStreamNotFound = fmt.Errorf("Stream not found")
)
View Source
var (
	ErrTypeIssue = fmt.Errorf("Type issue")
)

Functions

func IsFatal

func IsFatal(err error) (fatal bool, e error)

func LoadConfig

func LoadConfig(filename string, config *Config) error

Types

type Config

type Config struct {
	Pid    string
	Script string
	Stream map[string]map[string]interface{}
	Agent  map[string]map[string]interface{}
	// contains filtered or unexported fields
}

func (Config) Save

func (config Config) Save() error

func (Config) SaveTo

func (config Config) SaveTo(filename string) error

type Encoder

type Encoder interface {
	Encode(interface{}) error
}

type Entity

type Entity struct {
	Id   bson.ObjectId
	Tag  map[string]bool
	Time time.Time
	Data string
	// contains filtered or unexported fields
}

func (*Entity) Response

func (r *Entity) Response() error

type GobDownStream

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

func (*GobDownStream) Close

func (gs *GobDownStream) Close() error

func (*GobDownStream) Init

func (gs *GobDownStream) Init(config map[string]interface{}, service *Service) error

func (*GobDownStream) Serve

func (gs *GobDownStream) Serve() error

func (*GobDownStream) Write

func (gs *GobDownStream) Write(e Entity) error

type GobUpStream

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

func (*GobUpStream) Close

func (gs *GobUpStream) Close() error

func (*GobUpStream) Init

func (gs *GobUpStream) Init(config map[string]interface{}, service *Service) error

func (*GobUpStream) Serve

func (gs *GobUpStream) Serve() error

func (*GobUpStream) Write

func (gs *GobUpStream) Write(e Entity) error

type HttpStream

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

func (*HttpStream) Close

func (hs *HttpStream) Close() error

func (*HttpStream) Init

func (hs *HttpStream) Init(config map[string]interface{}, service *Service) error

func (*HttpStream) Serve

func (hs *HttpStream) Serve() error

func (*HttpStream) Write

func (hs *HttpStream) Write(e Entity) error

type LuaIpt

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

func (*LuaIpt) Bind

func (luaipt *LuaIpt) Bind(name string, item interface{}) error

func (*LuaIpt) Exec

func (luaipt *LuaIpt) Exec(name string, params interface{}) error

func (*LuaIpt) Final

func (luaipt *LuaIpt) Final() error

func (*LuaIpt) Init

func (luaipt *LuaIpt) Init(path string) error

type Service

type Service struct {
	sync.RWMutex

	ErrorHandler func(error)
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Service, error)

func (*Service) Close

func (s *Service) Close()

func (*Service) Done

func (s *Service) Done(id bson.ObjectId)

func (*Service) Pass

func (s *Service) Pass(name string, e Entity) error

func (*Service) Serve

func (s *Service) Serve() error

func (*Service) Write

func (s *Service) Write(e Entity)

type Stream

type Stream interface {
	Init(map[string]interface{}, *Service) error
	Serve() error
	Write(Entity) error
	Close() error
}

func NewGobDownStream

func NewGobDownStream() Stream

func NewGobUpStream

func NewGobUpStream() Stream

func NewHttpStream

func NewHttpStream() Stream

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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