Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type Initializer
- type Option
- type Simple
- func (s *Simple) AddRegistryTags(tags ...string)
- func (s *Simple) Address() string
- func (s *Simple) GetMetadata(key string) interface{}
- func (s *Simple) HasInitializer() bool
- func (s *Simple) Host() string
- func (s *Simple) Initializer() component.Initializer
- func (s *Simple) Port() int
- func (s *Simple) RegistryTags() []string
- func (s *Simple) String() string
Constants ¶
View Source
const (
// SERVER_TYPE is the type of the server.
SERVER_TYPE = "simple"
)
Variables ¶
View Source
var ( // ErrRequiredGRPCRegistrar returned when gRPC registration callback is not provided ErrRequiredGRPCRegistrar = errors.New("gRPC registration callback is required") // ErrGRPCConfigLoad returned when env config for GRPC results in an error ErrGRPCConfigLoad = errors.New("error loading grpc config") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Host string `env:"SERVER_HOST,defaut="` Port int `env:"SERVER_PORT,default=8080"` Tags string `env:"SERVER_CONSUL_TAGS,default="` }
Config manages the HTTP server config
func NewConfig ¶
func NewConfig() *Config
NewConfig returns the parsed config for jetstream from env
type Initializer ¶
type Initializer struct {
// contains filtered or unexported fields
}
func NewInitializer ¶
func NewInitializer(s *Simple) *Initializer
NewInitializer returns a new JetStream Initialiazer
func (*Initializer) AddDependency ¶
func (i *Initializer) AddDependency(dep interface{}) error
AddDependency adds necessary service components as dependencies
func (*Initializer) CanRun ¶
func (i *Initializer) CanRun() bool
CanRun returns true if the component has anything to Run
func (*Initializer) CanStop ¶
func (i *Initializer) CanStop() bool
CanRun returns true if the component has anything to Run
func (*Initializer) Dependencies ¶
func (i *Initializer) Dependencies() []string
Dependencies returns the string names of service components that are required as dependencies for this component
type Simple ¶
type Simple struct { *Config // contains filtered or unexported fields }
Grpc holds gRPC config
func (*Simple) AddRegistryTags ¶
AddRegistryTags - sets the registry tags for the server
func (*Simple) GetMetadata ¶
GetMetadata returns the metadata by key
func (*Simple) HasInitializer ¶
func (*Simple) Initializer ¶
func (s *Simple) Initializer() component.Initializer
func (*Simple) RegistryTags ¶
RegistryTags returns gRPC server registry tags
Click to show internal directories.
Click to hide internal directories.