ik

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

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

Go to latest
Published: Oct 14, 2015 License: MIT Imports: 16 Imported by: 0

README

Ik

Ik (pronounced ai-kay) is planned to be a humble alternative implementation of fluentd.

"Ik" is also a Dutch word for "I" in English and it concidentally looks very much like the Japanese word "Iku" that literally means "Go".

Installation

$ go get github.com/moriyoshi/ik/entrypoints/ik

Authors

In alphabetical order:

  • Moriyoshi Koizumi
  • Shinji Tanaka

Documentation

Index

Constants

View Source
const (
	Red        = 0x00001
	Green      = 0x00002
	Yellow     = 0x00003
	Blue       = 0x00004
	Magenta    = 0x00005
	Cyan       = 0x00006
	White      = 0x00007
	Embolden   = 0x10000
	Underlined = 0x20000
)
View Source
const (
	Spawned = 1
	Stopped = 2
)

Variables

View Source
var Continue = &ContinueType{}
View Source
var NotFound = &NotFoundType{}

Functions

func BuildRegexpFromGlobPattern

func BuildRegexpFromGlobPattern(pattern string) (string, error)

func Glob

func Glob(fs http.FileSystem, pattern string) ([]string, error)

func NewEngine

func NewEngine(logger Logger, opener Opener, lineParserPluginRegistry LineParserPluginRegistry, scorekeeper *Scorekeeper, defaultPort Port) *engineImpl

func NewRandSourceWithTimestampSeed

func NewRandSourceWithTimestampSeed() rand.Source

func ParseCapacityString

func ParseCapacityString(s string) (int64, error)

Types

type Config

type Config struct {
	Root *ConfigElement
}

func ParseConfig

func ParseConfig(opener Opener, filename string) (*Config, error)

type ConfigElement

type ConfigElement struct {
	Name  string
	Args  string
	Attrs map[string]string
	Elems []*ConfigElement
}

type ContinueType

type ContinueType struct{}

func (*ContinueType) Error

func (_ *ContinueType) Error() string

type DefaultLineReader

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

func NewDefaultLineReader

func NewDefaultLineReader(filename string, reader io.Reader) *DefaultLineReader

func (*DefaultLineReader) Close

func (reader *DefaultLineReader) Close() error

func (*DefaultLineReader) Filename

func (reader *DefaultLineReader) Filename() string

func (*DefaultLineReader) LineNumber

func (reader *DefaultLineReader) LineNumber() int

func (*DefaultLineReader) Next

func (reader *DefaultLineReader) Next() (string, error)

type DefaultOpener

type DefaultOpener http.Dir

func (DefaultOpener) BasePath

func (opener DefaultOpener) BasePath() string

func (DefaultOpener) FileSystem

func (opener DefaultOpener) FileSystem() http.FileSystem

func (DefaultOpener) NewOpener

func (opener DefaultOpener) NewOpener(path_ string) Opener

func (DefaultOpener) Open

func (opener DefaultOpener) Open(filename string) (http.File, error)

type Disposable

type Disposable interface {
	Dispose() error
}

type Engine

type Engine interface {
	Disposable
	Logger() Logger
	Opener() Opener
	LineParserPluginRegistry() LineParserPluginRegistry
	RandSource() rand.Source
	Scorekeeper() *Scorekeeper
	DefaultPort() Port
	Spawn(Spawnee) error
	Launch(PluginInstance) error
	SpawneeStatuses() ([]SpawneeStatus, error)
	PluginInstances() []PluginInstance
	RecurringTaskScheduler() *task.RecurringTaskScheduler
}

type Fanout

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

func (*Fanout) AddPort

func (fanout *Fanout) AddPort(port Port)

func (*Fanout) Emit

func (fanout *Fanout) Emit(recordSets []FluentRecordSet) error

type FluentConfigurer

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

func NewFluentConfigurer

func NewFluentConfigurer(logger Logger, inputFactoryRegistry InputFactoryRegistry, outputFactoryRegistry OutputFactoryRegistry, router *FluentRouter) *FluentConfigurer

func (*FluentConfigurer) Configure

func (configurer *FluentConfigurer) Configure(engine Engine, config *Config) error

type FluentRecord

type FluentRecord struct {
	Tag       string
	Timestamp uint64
	Data      map[string]interface{}
}

type FluentRecordSet

type FluentRecordSet struct {
	Tag     string
	Records []TinyFluentRecord
}

type FluentRouter

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

func NewFluentRouter

func NewFluentRouter() *FluentRouter

func (*FluentRouter) AddRule

func (router *FluentRouter) AddRule(pattern string, port Port) error

func (*FluentRouter) Emit

func (router *FluentRouter) Emit(recordSets []FluentRecordSet) error

type Input

type Input interface {
	PluginInstance
	Port() Port
}

type InputFactory

type InputFactory interface {
	Plugin
	New(engine Engine, config *ConfigElement) (Input, error)
}

type InputFactoryRegistry

type InputFactoryRegistry interface {
	RegisterInputFactory(factory InputFactory) error
	LookupInputFactory(name string) InputFactory
}

type IntVector

type IntVector []int

func (*IntVector) Append

func (sv *IntVector) Append(v int)

func (*IntVector) First

func (sv *IntVector) First() int

func (*IntVector) Last

func (sv *IntVector) Last() int

func (*IntVector) Pop

func (sv *IntVector) Pop() int

func (*IntVector) Push

func (sv *IntVector) Push(v int)

func (*IntVector) Shift

func (sv *IntVector) Shift() int

type Journal

type Journal interface {
	Disposable
	Key() string
	Write(data []byte) error
	GetTailChunk() JournalChunk
	AddNewChunkListener(JournalChunkListener)
	AddFlushListener(JournalChunkListener)
	Flush(func(JournalChunk) error) error
}

type JournalChunk

type JournalChunk interface {
	Disposable
	GetReader() (io.Reader, error)
	GetNextChunk() JournalChunk
	TakeOwnership() bool
}

type JournalChunkListener

type JournalChunkListener func(JournalChunk) error

type JournalGroup

type JournalGroup interface {
	Disposable
	GetJournal(key string) Journal
	GetJournalKeys() []string
}

type JournalGroupFactory

type JournalGroupFactory interface {
	GetJournalGroup() JournalGroup
}

type LineParser

type LineParser interface {
	Feed(line string) error
}

type LineParserFactory

type LineParserFactory interface {
	New(receiver func(FluentRecord) error) (LineParser, error)
}

type LineParserFactoryFactory

type LineParserFactoryFactory func(engine Engine, config *ConfigElement) (LineParserFactory, error)

type LineParserPlugin

type LineParserPlugin interface {
	Name() string
	OnRegistering(func(name string, factory LineParserFactoryFactory) error) error
}

type LineParserPluginRegistry

type LineParserPluginRegistry interface {
	RegisterLineParserPlugin(plugin LineParserPlugin) error
	LookupLineParserFactoryFactory(name string) LineParserFactoryFactory
}

type LineReader

type LineReader interface {
	Next() (string, error)
	Close() error
	Filename() string
	LineNumber() int
}

func NewLineReader

func NewLineReader(opener Opener, filename string) (LineReader, error)

type Logger

type Logger interface {
	Critical(format string, args ...interface{})
	Error(format string, args ...interface{})
	Warning(format string, args ...interface{})
	Notice(format string, args ...interface{})
	Info(format string, args ...interface{})
	Debug(format string, args ...interface{})
}

type Markup

type Markup struct {
	Chunks []MarkupChunk
}

type MarkupAttributes

type MarkupAttributes int

type MarkupChunk

type MarkupChunk struct {
	Attrs MarkupAttributes
	Text  string
}

type NotFoundType

type NotFoundType struct{}

func (*NotFoundType) Error

func (_ *NotFoundType) Error() string

type Opener

type Opener interface {
	FileSystem() http.FileSystem
	BasePath() string
	NewOpener(path string) Opener
}

type Output

type Output interface {
	PluginInstance
	Port
}

type OutputFactory

type OutputFactory interface {
	Plugin
	New(engine Engine, config *ConfigElement) (Output, error)
}

type OutputFactoryRegistry

type OutputFactoryRegistry interface {
	RegisterOutputFactory(factory OutputFactory) error
	LookupOutputFactory(name string) OutputFactory
}

type Panicked

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

func (*Panicked) Error

func (panicked *Panicked) Error() string

type PatternError

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

func (*PatternError) Error

func (self *PatternError) Error() string

type Plugin

type Plugin interface {
	Name() string
	BindScorekeeper(*Scorekeeper)
}

type PluginInstance

type PluginInstance interface {
	Spawnee
	Factory() Plugin
}

type PluginRegistry

type PluginRegistry interface {
	Plugins() []Plugin
}

type Port

type Port interface {
	Emit(recordSets []FluentRecordSet) error
}

type RecordPacker

type RecordPacker interface {
	Pack(record FluentRecord) ([]byte, error)
}

type RecordPump

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

func NewRecordPump

func NewRecordPump(port Port, backlog int) *RecordPump

func (*RecordPump) EmitOne

func (pump *RecordPump) EmitOne(record FluentRecord)

func (*RecordPump) Port

func (pump *RecordPump) Port() Port

func (*RecordPump) Run

func (pump *RecordPump) Run() error

func (*RecordPump) Shutdown

func (pump *RecordPump) Shutdown() error

type ScoreValueFetcher

type ScoreValueFetcher interface {
	PlainText(PluginInstance) (string, error)
	Markup(PluginInstance) (Markup, error)
}

type Scoreboard

type Scoreboard interface {
	PluginInstance
}

type ScoreboardFactory

type ScoreboardFactory interface {
	Plugin
	New(engine Engine, pluginRegistry PluginRegistry, config *ConfigElement) (Scoreboard, error)
}

type Scorekeeper

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

func NewScorekeeper

func NewScorekeeper(logger Logger) *Scorekeeper

func (*Scorekeeper) AddTopic

func (sk *Scorekeeper) AddTopic(topic ScorekeeperTopic)

func (*Scorekeeper) Dispose

func (sk *Scorekeeper) Dispose()

func (*Scorekeeper) Fetch

func (sk *Scorekeeper) Fetch(plugin Plugin, name string) (ScoreValueFetcher, error)

func (*Scorekeeper) GetPlugins

func (sk *Scorekeeper) GetPlugins() []Plugin

func (*Scorekeeper) GetTopics

func (sk *Scorekeeper) GetTopics(plugin Plugin) []ScorekeeperTopic

type ScorekeeperTopic

type ScorekeeperTopic struct {
	Plugin      Plugin
	Name        string
	DisplayName string
	Description string
	Fetcher     ScoreValueFetcher
}

type Slicer

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

func NewSlicer

func NewSlicer(journalGroup JournalGroup, keyGetter func(record FluentRecord) string, packer RecordPacker, logger Logger) *Slicer

func (*Slicer) AddNewKeyEventListener

func (slicer *Slicer) AddNewKeyEventListener(listener SlicerNewKeyEventListener)

func (*Slicer) Emit

func (slicer *Slicer) Emit(recordSets []FluentRecordSet) error

type SlicerNewKeyEventListener

type SlicerNewKeyEventListener func(last Journal, next Journal) error

type Spawnee

type Spawnee interface {
	Run() error
	Shutdown() error
}

type SpawneeStatus

type SpawneeStatus struct {
	Id         int
	Spawnee    Spawnee
	ExitStatus error
}

type Spawner

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

func NewSpawner

func NewSpawner() *Spawner

func (*Spawner) GetRunningSpawnees

func (spawner *Spawner) GetRunningSpawnees() ([]Spawnee, error)

func (*Spawner) GetSpawneeStatuses

func (spawner *Spawner) GetSpawneeStatuses() ([]SpawneeStatus, error)

func (*Spawner) GetStatus

func (spawner *Spawner) GetStatus(spawnee Spawnee) error

func (*Spawner) GetStoppedSpawnees

func (spawner *Spawner) GetStoppedSpawnees() ([]Spawnee, error)

func (*Spawner) Kill

func (spawner *Spawner) Kill(spawnee Spawnee) (bool, error)

func (*Spawner) Poll

func (spawner *Spawner) Poll(spawnee Spawnee) error

func (*Spawner) PollMultiple

func (spawner *Spawner) PollMultiple(spawnees []Spawnee) error

func (*Spawner) Spawn

func (spawner *Spawner) Spawn(spawnee Spawnee) error

type StringVector

type StringVector []string

func (*StringVector) Append

func (sv *StringVector) Append(v string)

func (*StringVector) First

func (sv *StringVector) First() string

func (*StringVector) Last

func (sv *StringVector) Last() string

func (*StringVector) Pop

func (sv *StringVector) Pop() string

func (*StringVector) Push

func (sv *StringVector) Push(v string)

func (*StringVector) Shift

func (sv *StringVector) Shift() string

type TinyFluentRecord

type TinyFluentRecord struct {
	Timestamp uint64
	Data      map[string]interface{}
}

Directories

Path Synopsis
entrypoints
ik
ikb

Jump to

Keyboard shortcuts

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