server

package
v0.0.0-...-e28080d Latest Latest
Warning

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

Go to latest
Published: May 22, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndPoint

func EndPoint() string

func StartDebugServer

func StartDebugServer()

Package golang.org/x/net/trace exports two http handlers for tracing:

/debug/requests /debug/events

ex: http://localhost:8081/debug/requests

Types

type Cobra

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

func NewCobra

func NewCobra(rootCmd *cobra.Command) *Cobra

func (*Cobra) AddPlugin

func (c *Cobra) AddPlugin(ctx context.Context, plug *plugin.Plugin, bus events.IEventBus)

type ILoader

type ILoader interface {
	Load() (err error)
}

type KedsRPCServer

type KedsRPCServer struct {
	Cobra *Cobra
	// contains filtered or unexported fields
}

RegisterPlugin implements the gRPC interface for keds.proto

func NewKedsRPCServer

func NewKedsRPCServer() *KedsRPCServer

func (*KedsRPCServer) ConsoleWriter

func (s *KedsRPCServer) ConsoleWriter(stream pb.KedsService_ConsoleWriterServer) error

ConsoleWriter gRPC interface method implementation Inbound only stream allows clients to write to the console (STDOUT)

func (*KedsRPCServer) EventBus

func (s *KedsRPCServer) EventBus(stream pb.KedsService_EventBusServer) (err error)

EventBus gRPC interface method implementation Inbound and outbound stream that allows plugins to send and receive events generated by other plugins or the server.

func (*KedsRPCServer) RegisterPlugin

func (s *KedsRPCServer) RegisterPlugin(ctx context.Context, req *pb.RegisterPluginRequest) (resp *pb.RegisterPluginResponse, err error)

RegisterPlugin gRPC interface method implementation plugins must be registered first before invoking other methods

func (*KedsRPCServer) Start

func (s *KedsRPCServer) Start()

type Loader

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

func NewLoader

func NewLoader(loadPath []string) *Loader

func (*Loader) BuildCmd

func (l *Loader) BuildCmd(exPath string) (cmd *exec.Cmd)

func (*Loader) FindPluginsInPath

func (l *Loader) FindPluginsInPath(path string) (cmds []string)

func (*Loader) Load

func (l *Loader) Load() (err error)

func (*Loader) StartCmd

func (l *Loader) StartCmd(cmd *exec.Cmd) (err error)

type ServerListener

type ServerListener struct {
	EventBus events.IEventBus
	// contains filtered or unexported fields
}

func NewServerListener

func NewServerListener(eb events.IEventBus, server *KedsRPCServer) *ServerListener

func (*ServerListener) Listen

func (m *ServerListener) Listen(ctx context.Context) (quitc chan struct{}, err error)

func (*ServerListener) Receive

func (m *ServerListener) Receive(ctx context.Context, event *pb.PluginEvent) (err error)

func (ServerListener) String

func (m ServerListener) String() string

type StreamListener

type StreamListener struct {
	EventBus events.IEventBus
	Stream   pb.KedsService_EventBusServer
	// contains filtered or unexported fields
}

func NewStreamListener

func NewStreamListener(eb events.IEventBus, stream pb.KedsService_EventBusServer, name string) *StreamListener

func (*StreamListener) Listen

func (m *StreamListener) Listen(ctx context.Context) (quitc chan struct{}, err error)

func (*StreamListener) Receive

func (m *StreamListener) Receive(ctx context.Context, event *pb.PluginEvent) (err error)

func (StreamListener) String

func (m StreamListener) String() string

Jump to

Keyboard shortcuts

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