Documentation ¶
Index ¶
- Constants
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type Application
- func (app *Application) Brokers() []string
- func (app *Application) ConnString() string
- func (app *Application) EnvVar() []string
- func (app *Application) FunctionInvoker() string
- func (app *Application) Invoke(msg Message)
- func (app *Application) InvokeFunc(msg Message) error
- func (app *Application) LogStorageDriver() string
- func (app *Application) Name() string
- func (app *Application) Start(readyChan chan int, withWriteProxy bool) error
- func (app *Application) Topics() []string
- func (app *Application) WriteProxyListen() string
- type Config
- type Event
- type KafkaConsumer
- type KafkaProducer
- type LogStorageConsumer
- type LogStorageProducer
- type MemoryConsumer
- type MemoryProducer
- type Message
- type NginxConfig
- type PGConsumer
- type PGProducer
- type Pool
- type Work
- type Worker
- type WriteProxy
- type WriteRequest
Constants ¶
const CONFIG_VERSION = 1
const DEFAULT_CONSUMER_GROUP = "spacer-$appName"
const DEFAULT_FUNCTION_INVOKER = "http://localhost:3000"
const DEFAULT_WRITE_PROXY_LISTEN = ":9065"
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type Application ¶
type Application struct { Log *log.Entry Triggers map[Event][]*url.URL WorkerPool *Pool ConsumerGroupID string Env string // contains filtered or unexported fields }
func NewApplication ¶
func NewApplication(configFile string, env string) (*Application, error)
func (*Application) Brokers ¶
func (app *Application) Brokers() []string
func (*Application) ConnString ¶
func (app *Application) ConnString() string
func (*Application) EnvVar ¶
func (app *Application) EnvVar() []string
func (*Application) FunctionInvoker ¶
func (app *Application) FunctionInvoker() string
func (*Application) Invoke ¶
func (app *Application) Invoke(msg Message)
func (*Application) InvokeFunc ¶
func (app *Application) InvokeFunc(msg Message) error
For WorkerPool
func (*Application) LogStorageDriver ¶
func (app *Application) LogStorageDriver() string
func (*Application) Name ¶
func (app *Application) Name() string
func (*Application) Start ¶
func (app *Application) Start(readyChan chan int, withWriteProxy bool) error
func (*Application) Topics ¶
func (app *Application) Topics() []string
func (*Application) WriteProxyListen ¶
func (app *Application) WriteProxyListen() string
type Config ¶
func NewProjectConfig ¶
type KafkaConsumer ¶
type KafkaConsumer struct {
// contains filtered or unexported fields
}
func NewKafkaConsumer ¶
func NewKafkaConsumer(app *Application) (*KafkaConsumer, error)
func (*KafkaConsumer) Close ¶
func (kc *KafkaConsumer) Close() error
type KafkaProducer ¶
type KafkaProducer struct {
// contains filtered or unexported fields
}
func NewKafkaProducer ¶
func NewKafkaProducer(app *Application) (*KafkaProducer, error)
func (*KafkaProducer) Close ¶
func (kp *KafkaProducer) Close() error
func (*KafkaProducer) CreateTopics ¶
func (kp *KafkaProducer) CreateTopics(topics []string) error
func (*KafkaProducer) Events ¶
func (kp *KafkaProducer) Events() chan Message
func (*KafkaProducer) ProduceChannel ¶
func (kp *KafkaProducer) ProduceChannel() chan Message
type LogStorageConsumer ¶
type LogStorageProducer ¶
type MemoryConsumer ¶
type MemoryConsumer struct {
// contains filtered or unexported fields
}
func NewMemoryConsumer ¶
func NewMemoryConsumer() *MemoryConsumer
func (*MemoryConsumer) Close ¶
func (mc *MemoryConsumer) Close() error
type MemoryProducer ¶
type MemoryProducer struct {
// contains filtered or unexported fields
}
func NewMemoryProducer ¶
func NewMemoryProducer() *MemoryProducer
func (*MemoryProducer) Close ¶
func (mp *MemoryProducer) Close() error
func (*MemoryProducer) CreateTopics ¶
func (mp *MemoryProducer) CreateTopics(topics []string) error
func (*MemoryProducer) Events ¶
func (mp *MemoryProducer) Events() chan Message
func (*MemoryProducer) ProduceChannel ¶
func (mp *MemoryProducer) ProduceChannel() chan Message
type NginxConfig ¶
type PGConsumer ¶
type PGConsumer struct {
// contains filtered or unexported fields
}
func NewPGConsumer ¶
func NewPGConsumer(app *Application) (*PGConsumer, error)
func (*PGConsumer) Close ¶
func (c *PGConsumer) Close() error
type PGProducer ¶
type PGProducer struct {
// contains filtered or unexported fields
}
func NewPGProducer ¶
func NewPGProducer(app *Application) (*PGProducer, error)
func (*PGProducer) Close ¶
func (p *PGProducer) Close() error
func (*PGProducer) CreateTopics ¶
func (p *PGProducer) CreateTopics(topics []string) error
func (*PGProducer) Events ¶
func (p *PGProducer) Events() chan Message
func (*PGProducer) ProduceChannel ¶
func (p *PGProducer) ProduceChannel() chan Message
type WriteProxy ¶
type WriteProxy struct {
// contains filtered or unexported fields
}
func NewWriteProxy ¶
func NewWriteProxy(app *Application, produceChan chan Message) (*WriteProxy, error)
func (WriteProxy) ServeHTTP ¶
func (p WriteProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)
type WriteRequest ¶
type WriteRequest struct { Topic string `json:"topic"` Entries map[string]json.RawMessage `json:"entries"` }