Documentation ¶
Index ¶
- Constants
- type ConnStore
- type GrpCox
- func (g *GrpCox) CloseActiveConns(host string) error
- func (g *GrpCox) Extend(host string)
- func (g *GrpCox) GetActiveConns() []string
- func (g *GrpCox) GetKnownServers() []string
- func (g *GrpCox) GetResource(ctx context.Context, target string, plainText, isRestartConn bool) (*Resource, error)
- func (g *GrpCox) GetResourceWithProto(ctx context.Context, target string, plainText, isRestartConn bool, ...) (*Resource, error)
- type Proto
- type Resource
- func (r *Resource) AddProtos(protos []Proto) error
- func (r *Resource) Close()
- func (r *Resource) Describe(symbol string) (string, string, error)
- func (r *Resource) Invoke(ctx context.Context, metadata []string, symbol string, in io.Reader) (string, time.Duration, error)
- func (r *Resource) List(symbol string) ([]string, error)
Constants ¶
const BasePath = "/tmp/grpcox/"
BasePath define path where proto file will persisted
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnStore ¶
ConnStore - connection store instance
func NewConnectionStore ¶
func NewConnectionStore() *ConnStore
NewConnectionStore - constructor connection store
type GrpCox ¶
type GrpCox struct { KeepAlive float64 // contains filtered or unexported fields }
GrpCox - main object
func (*GrpCox) CloseActiveConns ¶
CloseActiveConns - close conn by host or all
func (*GrpCox) GetActiveConns ¶
GetActiveConns - get all saved active connection
func (*GrpCox) GetKnownServers ¶
type Proto ¶
Proto define protofile uploaded from client will be used to be persisted to disk and indicator whether connections should reflect from server or local proto
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
Resource - hold 3 main function (List, Describe, and Invoke)
func (*Resource) AddProtos ¶
AddProtos to resource properties and harddisk added protos will be persisted in `basepath + connection target` i.e. connection target == 127.0.0.1:8888 proto files will be persisted in /tmp/grpcox/127.0.0.1:8888 if the directory is already there, remove it first
func (*Resource) Close ¶
func (r *Resource) Close()
Close - to close all resources that was opened before
func (*Resource) Describe ¶
Describe - The "describe" verb will print the type of any symbol that the server knows about or that is found in a given protoset file. It also prints a description of that symbol, in the form of snippets of proto source. It won't necessarily be the original source that defined the element, but it will be equivalent.