Documentation
¶
Overview ¶
Package context sets up the developer context.
Package config defines the specific parameters of the Contexts and Dev Context
Index ¶
- Constants
- func SetDevDefaults(engine configClient.Interface) error
- type Context
- func (ctx *Context) Close() error
- func (ctx *Context) Config() configClient.Interface
- func (ctx *Context) DepClient() dep_client.Interface
- func (ctx *Context) IsConfigRunning() bool
- func (ctx *Context) IsDepManagerRunning() bool
- func (ctx *Context) IsProxyHandlerRunning() bool
- func (ctx *Context) IsRunning() bool
- func (ctx *Context) ProxyClient() proxy_client.Interface
- func (ctx *Context) SetConfig(socket configClient.Interface)
- func (ctx *Context) SetDepClient(dc dep_client.Interface) error
- func (ctx *Context) SetProxyClient(proxyClient proxy_client.Interface) error
- func (ctx *Context) SetService(id string, url string)
- func (ctx *Context) StartConfig() error
- func (ctx *Context) StartDepManager() error
- func (ctx *Context) StartProxyHandler() error
- func (ctx *Context) Type() ContextType
- type ContextType
- type Interface
Constants ¶
const ( // SrcKey is the path of source directory from the configuration SrcKey = "SERVICE_DEPS_SRC" // BinKey is the path of bin directory from the configuration BinKey = "SERVICE_DEPS_BIN" )
Specifically for Dev Context
Variables ¶
This section is empty.
Functions ¶
func SetDevDefaults ¶
func SetDevDefaults(engine configClient.Interface) error
SetDevDefaults sets the required developer context's parameters in the configuration engine.
It sets the source manager's bin path and source path in (dot is current dir by executable):
/bin.exe /_sds/source/ /_sds/bin/ /_sds/source/github.com.ahmetson.proxy-lib/main.go /_sds/bin/github.com.ahmetson.proxy-lib.exe
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
A Context handles the config of the contexts
func NewDev ¶
NewDev creates Developer context. Loads it with the Dev Configuration and Dev DepManager Manager.
func (*Context) Close ¶
Close the dep handler and config handler. The dep manager client is not closed
func (*Context) Config ¶
func (ctx *Context) Config() configClient.Interface
Config returns the config engine in the context.
func (*Context) DepClient ¶
func (ctx *Context) DepClient() dep_client.Interface
func (*Context) IsConfigRunning ¶
func (*Context) IsDepManagerRunning ¶
func (*Context) IsProxyHandlerRunning ¶
func (*Context) ProxyClient ¶
func (ctx *Context) ProxyClient() proxy_client.Interface
ProxyClient returns the client that works with proxies
func (*Context) SetConfig ¶
func (ctx *Context) SetConfig(socket configClient.Interface)
SetConfig sets the config engine of the given type. For the development context, it could be config-lib that reads the local file system.
Setting up the configuration prepares the context by creating directories.
func (*Context) SetDepClient ¶
func (ctx *Context) SetDepClient(dc dep_client.Interface) error
func (*Context) SetProxyClient ¶
func (ctx *Context) SetProxyClient(proxyClient proxy_client.Interface) error
SetProxyClient sets the client that works with proxies
func (*Context) SetService ¶
SetService sets the service id and url for which this context belongs too.
func (*Context) StartConfig ¶
StartConfig starts the config engine.
func (*Context) StartDepManager ¶
StartDepManager starts the dependency manager
func (*Context) StartProxyHandler ¶
StartProxyHandler starts the proxy handler
func (*Context) Type ¶
func (ctx *Context) Type() ContextType
Type returns the context type. Useful to identify contexts in the generic functions.
type ContextType ¶
type ContextType = string
const ( // DevContext indicates that all dependency proxies are in the local machine DevContext ContextType = "development" // UnknownContext indicates that the context is unspecified. UnknownContext ContextType = "unknown" ContextFlag = "context" )
type Interface ¶
type Interface interface { SetConfig(p configClient.Interface) Config() configClient.Interface SetProxyClient(p proxy_client.Interface) error ProxyClient() proxy_client.Interface Type() ContextType StartConfig() error StartDepManager() error StartProxyHandler() error Close() error // Close the dep handler and config handler. The dep manager client is not closed IsRunning() bool IsConfigRunning() bool IsDepManagerRunning() bool IsProxyHandlerRunning() bool SetService(string, string) // SetService sets the service parameters SetDepClient(p dep_client.Interface) error DepClient() dep_client.Interface }
func New ¶
func New(ctxTypes ...ContextType) (Interface, error)
A New orchestra. Optionally pass the type of the context. Or the context type could be retrieved from the config.ContextFlag.
Directories
¶
Path | Synopsis |
---|---|
Package dep_handler creates a thread that manages the dependencies
|
Package dep_handler creates a thread that manages the dependencies |
Package dep_manager tracks the dependency manager in the local context.
|
Package dep_manager tracks the dependency manager in the local context. |
Package proxy_client defines a client that works with the Proxy thread.
|
Package proxy_client defines a client that works with the Proxy thread. |
Package proxy_handler is a thread that manages the service proxies
|
Package proxy_handler is a thread that manages the service proxies |
Package source defines the dependency parameters in the 'dev' context.
|
Package source defines the dependency parameters in the 'dev' context. |