core

package
v0.0.0-...-d23ef4a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvPluginListenerAddress  = "ENV_PLUGIN_LISTENER_ADDRESS"
	EnvAllowPluginRpcProtocol = "ENV_ALLOW_PLUGIN_RPC_PROTOCOL"
	EnvRequestVersion         = "ENV_REQUEST_VERSION"

	MsgCoreVersion = "CoreVersion"
	MsgVersion     = "Version"
	MsgAddress     = "Address"
	MsgRpcProtocol = "RPCProtocol"
	MsgDone        = "DONE"
)

Variables

View Source
var CoreProtocolVersion, _ = utils.NewSemVerFromString("1.0.0-rc1")

Functions

func GetRandomListenerAddr

func GetRandomListenerAddr(forceTcp bool) (net.Addr, error)

func Listener

func Listener(forceTcp bool) (net.Listener, error)

Types

type Client

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

func NewClient

func NewClient(config *ClientConfig) (*Client, error)

func (*Client) Deploy

func (c *Client) Deploy(name string) (interface{}, error)

func (*Client) Protocol

func (c *Client) Protocol() (Protocol, error)

func (*Client) Start

func (c *Client) Start() error

func (*Client) Stop

func (c *Client) Stop() error

type ClientConfig

type ClientConfig struct {
	Plugins          map[string]ClientInstanceInterface
	Version          *utils.SemanticVersion
	Name             string
	Cmd              string
	Args             []string
	WorkDir          string
	Address          net.Addr
	StartTimeout     time.Duration
	AllowedProtocols Protocols
	TLS              *tls.Config
}

type ClientInstanceInterface

type ClientInstanceInterface interface {
	Instance(ctx context.Context, conn interface{}) (interface{}, error)
}

type ClientInterface

type ClientInterface interface {
	Initialization() error

	UnInitialization() error

	Deploy(name string) (interface{}, error)

	Ping(name string) error
}

func NewGRPCClient

func NewGRPCClient(context context.Context, config *ClientConfig) (ClientInterface, error)

type GRPCClient

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

func (*GRPCClient) Deploy

func (c *GRPCClient) Deploy(name string) (interface{}, error)

func (*GRPCClient) Initialization

func (c *GRPCClient) Initialization() error

func (*GRPCClient) Ping

func (c *GRPCClient) Ping(name string) error

func (*GRPCClient) UnInitialization

func (c *GRPCClient) UnInitialization() error

type Protocol

type Protocol int32
const (
	NoneProtocol Protocol = iota
	GRPCProtocol
)

func (Protocol) GoString

func (i Protocol) GoString() string

func (Protocol) String

func (i Protocol) String() string

type Protocols

type Protocols []Protocol

func (Protocols) Exist

func (ps Protocols) Exist(item Protocol) bool

func (Protocols) String

func (ps Protocols) String() string

Directories

Path Synopsis
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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