interfaces

package
v0.0.0-...-67991ef Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker interface {
	Run() error
	Endpoint() string
	Connect() error
	Publish(string, interface{}) error
	Subscribe(string, nats.MsgHandler) error
	Unsubscribe(string) error
	Close()
}

type Cache

type Cache interface {
	Put(string, interface{}) error
	Get(string) (interface{}, error)
}

type Processor

type Processor interface {
	Init(service Service) error
	Close() error
	Process(interface{}) (interface{}, error)
}

type Registry

type Registry interface {
	Register() error
}

type Service

type Service interface {
	//Modules
	Transport() Transport
	Registry() Registry
	Broker() Broker
	Store() Store
	Cache() Cache

	Running() bool
	HookShutDown(func())
	//Configuration
	Config(path string, defaultValue interface{}) interface{}

	//Log
	Error(string)
	Errorf(string, ...interface{})
	Info(string)
	Infof(string, ...interface{})
	Warn(string)
	Warnf(string, ...interface{})
	Fatal(string)
	Fatalf(string, ...interface{})
	Debug(string)
	Debugf(string, ...interface{})
}

type Store

type Store interface {
	Create(string, interface{}) error
	Read(string) (interface{}, error)
	Update(string, interface{}) error
	Delete(string) error
	List() ([]interface{}, error)
}

type Transport

type Transport interface {
	Run() error
	Stop() error
	GetHandler(string, interface{})
	PostHandler(string, interface{})
	PutHandler(string, interface{})
	DeleteHandler(string, interface{})
	Middleware(interface{})
	StaticFilesFolder(string, string)
}

Jump to

Keyboard shortcuts

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