data

package
v0.0.0-...-2e4994d Latest Latest
Warning

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

Go to latest
Published: May 14, 2014 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_DATA_ENCODING      = ""
	DEFAULT_DATA_SEND_INTERVAL = 63
)
View Source
const (
	WRITE_BUFFER = 100
	CACHE_SIZE   = 1024 * 1024 * 8 // 8M
)

Variables

View Source
var ErrSpoolTimeout = errors.New("Timeout spooling data")

Functions

This section is empty.

Types

type Config

type Config struct {
	Encoding     string
	SendInterval int
	Blackhole    bool
}

type DiskvSpooler

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

http://godoc.org/github.com/peterbourgon/diskv

func NewDiskvSpooler

func NewDiskvSpooler(logger *pct.Logger, dataDir string, hostname string) *DiskvSpooler

func (*DiskvSpooler) Files

func (s *DiskvSpooler) Files() <-chan string

func (*DiskvSpooler) Read

func (s *DiskvSpooler) Read(file string) ([]byte, error)

func (*DiskvSpooler) Remove

func (s *DiskvSpooler) Remove(file string) error

func (*DiskvSpooler) Start

func (s *DiskvSpooler) Start(sz Serializer) error

func (*DiskvSpooler) Status

func (s *DiskvSpooler) Status() map[string]string

func (*DiskvSpooler) Stop

func (s *DiskvSpooler) Stop() error

func (*DiskvSpooler) Write

func (s *DiskvSpooler) Write(service string, data interface{}) error

type JsonGzipSerializer

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

func NewJsonGzipSerializer

func NewJsonGzipSerializer() *JsonGzipSerializer

func (*JsonGzipSerializer) Concurrent

func (s *JsonGzipSerializer) Concurrent() bool

func (*JsonGzipSerializer) Encoding

func (s *JsonGzipSerializer) Encoding() string

func (*JsonGzipSerializer) ToBytes

func (s *JsonGzipSerializer) ToBytes(data interface{}) ([]byte, error)

type JsonSerializer

type JsonSerializer struct {
}

func NewJsonSerializer

func NewJsonSerializer() *JsonSerializer

func (*JsonSerializer) Concurrent

func (s *JsonSerializer) Concurrent() bool

func (*JsonSerializer) Encoding

func (s *JsonSerializer) Encoding() string

func (*JsonSerializer) ToBytes

func (j *JsonSerializer) ToBytes(data interface{}) ([]byte, error)

type Manager

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

func NewManager

func NewManager(logger *pct.Logger, dataDir string, hostname string, client pct.WebsocketClient) *Manager

func (*Manager) GetConfig

func (m *Manager) GetConfig() ([]proto.AgentConfig, []error)

func (*Manager) Handle

func (m *Manager) Handle(cmd *proto.Cmd) *proto.Reply

@goroutine[0]

func (*Manager) Sender

func (m *Manager) Sender() *Sender

func (*Manager) Spooler

func (m *Manager) Spooler() Spooler

func (*Manager) Start

func (m *Manager) Start() error

@goroutine[0]

func (*Manager) Status

func (m *Manager) Status() map[string]string

@goroutine[0:1]

func (*Manager) Stop

func (m *Manager) Stop() error

@goroutine[0]

type Sender

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

func NewSender

func NewSender(logger *pct.Logger, client pct.WebsocketClient) *Sender

func (*Sender) Start

func (s *Sender) Start(spool Spooler, tickerChan <-chan time.Time, blackhole bool) error

func (*Sender) Status

func (s *Sender) Status() map[string]string

func (*Sender) Stop

func (s *Sender) Stop() error

type Serializer

type Serializer interface {
	ToBytes(data interface{}) ([]byte, error)
	Encoding() string
	Concurrent() bool
}

type Spooler

type Spooler interface {
	Start(Serializer) error
	Stop() error
	Status() map[string]string
	Write(service string, data interface{}) error
	Files() <-chan string
	Read(key string) ([]byte, error)
	Remove(key string) error
}

Jump to

Keyboard shortcuts

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