process

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// APIURIFlag is the api-uri flag
	APIURIFlag = "api-uri"
	// APITokenFlag is the api-token flag
	APITokenFlag = "api-token"
	// HubURIFlag is the hub-uri flag
	HubURIFlag = "hub-uri"
	// ConfigAPIURIFlag is the config-api-uri flag
	ConfigAPIURIFlag = "config-api-uri"
	// RedisURIFlag is the redis-uri flag
	RedisURIFlag = "redis-uri"
	// TorURIFlag is the tor-uri flag
	TorURIFlag = "tor-uri"
	// UserAgentFlag is the user-agent flag
	UserAgentFlag = "user-agent"
)

Variables

This section is empty.

Functions

func MakeApp

func MakeApp(process Process) *cli.App

MakeApp return cli.App corresponding for given Process

Types

type Process

type Process interface {
	Name() string
	CommonFlags() []string
	CustomFlags() []cli.Flag
	Initialize(provider Provider) error
	Subscribers() []SubscriberDef
	HTTPHandler() http.Handler
}

Process is a component of Trandoshan

type Provider

type Provider interface {
	// Clock return a clock implementation
	Clock() (clock.Clock, error)
	// ConfigClient return a new configured configapi.Client
	ConfigClient(keys []string) (configapi.Client, error)
	// Subscriber return a new configured subscriber
	Subscriber() (event.Subscriber, error)
	// Publisher return a new configured publisher
	Publisher() (event.Publisher, error)
	// Cache return a new configured cache
	Cache(keyPrefix string) (cache.Cache, error)
	// HTTPClient return a new configured http client
	HTTPClient() (chttp.Client, error)
	// GetValue return value for given key
	GetValue(key string) string
	// GetValue return values for given key
	GetValues(key string) []string
}

Provider is the implementation provider

func NewDefaultProvider

func NewDefaultProvider(ctx *cli.Context) Provider

NewDefaultProvider create a brand new default provider using given cli.Context

type SubscriberDef

type SubscriberDef struct {
	Exchange string
	Queue    string
	Handler  event.Handler
}

SubscriberDef is the subscriber definition

Jump to

Keyboard shortcuts

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