Documentation
¶
Index ¶
- func AppendFunctionHandler(name string, function func(pload interface{}) interface{})
- func CloseAllConn()
- func GetStatusConn(name string) bool
- func InitConn(name string, host string, port int) error
- func RequestConfigs(ip string, port int)
- func RequestConfigsServer(port int)
- func RequestJSON(method string, json_content interface{}) (interface{}, error)
- func RequestJSONNew(method string, json_content interface{}, instanceName string) (interface{}, error)
- func ServeCalls()
- func SetTLSConfig(cert_path string, key_path string)
- func UseTLS()
- type ClientRsock
- func (cli *ClientRsock) AddRSockClient(client *rsocket.Client, instanceName string, hostName string, port int)
- func (cli *ClientRsock) FreeExistingSocket(client *ClientRsockDetails) error
- func (cli *ClientRsock) GetExistingOrNew(host string) (*ClientRsockDetails, error)
- func (cli *ClientRsock) GetStatusConnection(instanceName string) int
- type ClientRsockDetails
- type FunctionName
- type GenericList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendFunctionHandler ¶
func AppendFunctionHandler(name string, function func(pload interface{}) interface{})
func CloseAllConn ¶
func CloseAllConn()
func GetStatusConn ¶
func InitConn ¶
Starts singleton connection with server
Parameters:
- name: unique name of the instance
- host: the host or ip address
- port: the port of the host
func RequestConfigs ¶
func RequestConfigsServer ¶
func RequestConfigsServer(port int)
func RequestJSON ¶
func RequestJSONNew ¶
func RequestJSONNew(method string, json_content interface{}, instanceName string) (interface{}, error)
Creates a request with an existing connection to an instance.
Parameters:
- method: name of the method to be called in the endpoint
- json_content: parameters to be sent to the endpoint in JSON
- name: unique name of the instance
func ServeCalls ¶
func ServeCalls()
func SetTLSConfig ¶
Types ¶
type ClientRsock ¶
type ClientRsock struct {
// Cli rsocket.Client
FreeList map[string]map[string]*ClientRsockDetails
InUse map[string]map[string]*ClientRsockDetails
// contains filtered or unexported fields
}
func (*ClientRsock) AddRSockClient ¶
func (*ClientRsock) FreeExistingSocket ¶
func (cli *ClientRsock) FreeExistingSocket(client *ClientRsockDetails) error
func (*ClientRsock) GetExistingOrNew ¶
func (cli *ClientRsock) GetExistingOrNew(host string) (*ClientRsockDetails, error)
func (*ClientRsock) GetStatusConnection ¶
func (cli *ClientRsock) GetStatusConnection(instanceName string) int
Shows status of the RSsock client with the Unique Instance Name. Returns 1 if there is a free connection, 2 if there is a connection in use and -1 if there is no connection
Parameters:
- instanceName: unique name of the instance
type ClientRsockDetails ¶
type FunctionName ¶
type FunctionName struct {
Function func(pload interface{}) interface{}
Name string
}
type GenericList ¶
type GenericList struct {
Method string `json:"method"`
Payload interface{} `json:"payload"`
}
Click to show internal directories.
Click to hide internal directories.