models

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment struct {
	*viper.Viper

	*logrus.Logger
	// contains filtered or unexported fields
}

func (*Environment) CheckErrors

func (e *Environment) CheckErrors(errors []error) error

func (*Environment) GetBoolOrDefault

func (e *Environment) GetBoolOrDefault(path string, defaultValue bool) bool

func (*Environment) GetDurationOrDefault

func (e *Environment) GetDurationOrDefault(path string, defaultValue time.Duration) time.Duration

func (*Environment) GetFloat64OrDefault

func (e *Environment) GetFloat64OrDefault(path string, defaultValue float64) float64

func (*Environment) GetIntOrDefault

func (e *Environment) GetIntOrDefault(path string, defaultValue int) int

func (*Environment) GetStringOrDefault

func (e *Environment) GetStringOrDefault(path string, defaultValue string) string

type EnvironmentBuilder

type EnvironmentBuilder struct {
	*Environment
	// contains filtered or unexported fields
}

func NewEnvironmentBuilder

func NewEnvironmentBuilder() *EnvironmentBuilder

func (*EnvironmentBuilder) Build

func (eb *EnvironmentBuilder) Build() (*Environment, error)

func (*EnvironmentBuilder) WithConfigurationFile

func (eb *EnvironmentBuilder) WithConfigurationFile(config string) *EnvironmentBuilder

func (*EnvironmentBuilder) WithName

func (eb *EnvironmentBuilder) WithName(name string) *EnvironmentBuilder

func (*EnvironmentBuilder) WithRemoteConfiguration

func (eb *EnvironmentBuilder) WithRemoteConfiguration(provider, uri string) *EnvironmentBuilder

type Exception

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

func (Exception) Catch

func (e Exception) Catch(msg string)

func (Exception) Errors

func (e Exception) Errors() []error

type Microservice

type Microservice struct {
	*Environment
	// contains filtered or unexported fields
}

func (*Microservice) Broker

func (m *Microservice) Broker() interfaces.Broker

func (*Microservice) Cache

func (m *Microservice) Cache() interfaces.Cache

func (*Microservice) Close

func (m *Microservice) Close()

func (*Microservice) Config

func (m *Microservice) Config(path string, defaultValue interface{}) interface{}

func (*Microservice) Create

func (m *Microservice) Create(key string, value interface{}) error

func (*Microservice) Debug

func (m *Microservice) Debug(msg string)

func (*Microservice) Debugf

func (m *Microservice) Debugf(msg string, args ...interface{})

func (*Microservice) Delete

func (m *Microservice) Delete(key string) error

func (*Microservice) DeleteHandler

func (m *Microservice) DeleteHandler(endpoint string, handler interface{})

func (*Microservice) Error

func (m *Microservice) Error(msg string)

func (*Microservice) Errorf

func (m *Microservice) Errorf(msg string, args ...interface{})

func (*Microservice) Errors

func (m *Microservice) Errors() []error

func (*Microservice) Fatal

func (m *Microservice) Fatal(msg string)

func (*Microservice) Fatalf

func (m *Microservice) Fatalf(msg string, args ...interface{})

func (*Microservice) GetHandler

func (m *Microservice) GetHandler(endpoint string, handler interface{})

func (*Microservice) HookShutDown

func (m *Microservice) HookShutDown(fn func())

func (*Microservice) Info

func (m *Microservice) Info(msg string)

func (*Microservice) Infof

func (m *Microservice) Infof(msg string, args ...interface{})

func (*Microservice) List

func (m *Microservice) List() ([]interface{}, error)

func (*Microservice) Middleware

func (m *Microservice) Middleware(middleware func(*gin.Context))

func (*Microservice) PostHandler

func (m *Microservice) PostHandler(endpoint string, handler interface{})

func (*Microservice) Process

func (m *Microservice) Process(instance interface{}) (interface{}, error)

func (*Microservice) Publish

func (m *Microservice) Publish(topic string, handler interface{}) error

func (*Microservice) PutHandler

func (m *Microservice) PutHandler(endpoint string, handler interface{})

func (*Microservice) Read

func (m *Microservice) Read(key string) (interface{}, error)

func (*Microservice) Registry

func (m *Microservice) Registry() interfaces.Registry

func (*Microservice) Run

func (m *Microservice) Run()

func (*Microservice) Running

func (m *Microservice) Running() bool

func (*Microservice) StaticFilesFolder

func (m *Microservice) StaticFilesFolder(uri, folder string)

func (*Microservice) Store

func (m *Microservice) Store() interfaces.Store

func (*Microservice) Subscribe

func (m *Microservice) Subscribe(topic string, callback nats.MsgHandler) error

func (*Microservice) SubscribeDefault

func (m *Microservice) SubscribeDefault(handler nats.MsgHandler) error

func (*Microservice) Transport

func (m *Microservice) Transport() interfaces.Transport

func (*Microservice) Update

func (m *Microservice) Update(key string, value interface{}) error

func (*Microservice) Warn

func (m *Microservice) Warn(msg string)

func (*Microservice) Warnf

func (m *Microservice) Warnf(msg string, args ...interface{})

type MicroserviceBuilder

type MicroserviceBuilder struct {
	*Microservice
	Exception
}

func NewMicroserviceBuilder

func NewMicroserviceBuilder(environment *Environment) *MicroserviceBuilder

func (*MicroserviceBuilder) Build

func (mb *MicroserviceBuilder) Build() (*Microservice, error)

func (*MicroserviceBuilder) WithBroker

func (mb *MicroserviceBuilder) WithBroker(broker interfaces.Broker) *MicroserviceBuilder

func (*MicroserviceBuilder) WithCache

func (*MicroserviceBuilder) WithDiscovery

func (mb *MicroserviceBuilder) WithDiscovery(discovery interfaces.Registry) *MicroserviceBuilder

func (*MicroserviceBuilder) WithPlugin

func (mb *MicroserviceBuilder) WithPlugin(processor interfaces.Processor) *MicroserviceBuilder

func (*MicroserviceBuilder) WithStore

func (*MicroserviceBuilder) WithSubscription

func (mb *MicroserviceBuilder) WithSubscription(topic string, callback nats.MsgHandler) *MicroserviceBuilder

func (*MicroserviceBuilder) WithTransport

func (mb *MicroserviceBuilder) WithTransport(transport interfaces.Transport) *MicroserviceBuilder

Jump to

Keyboard shortcuts

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