rpc

package module
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error added in v2.0.2

type Error uint
const (
	ERROR_NONE Error = iota
	ERROR_NOT_MODIFIED
	ERROR_NOT_ENABLED
	ERROR_IMMUTABLE_PARAMETER
)

func (Error) Error added in v2.0.2

func (e Error) Error() string

func (Error) WithPrefix added in v2.0.2

func (e Error) WithPrefix(prefix string) error

type Gaffer added in v2.0.2

type Gaffer interface {
	gopi.Unit

	// Return services
	Services() []GafferService

	// Update a service
	Update(GafferService, []string) (GafferService, error)

	// Start a service process
	Start(context.Context, uint32) (GafferProcess, error)
}

Gaffer operations

type GafferClientStub added in v2.0.2

type GafferClientStub interface {
	gopi.RPCClientStub

	// Make a mutable service
	Mutable(GafferService) MutableGafferService

	// Ping returns without error if the remote service is running
	Ping(context.Context) error

	// Services returns a list of services registered
	Services(context.Context) ([]GafferService, error)

	// Update a service name, cwd, args, user, group or enabled field
	Update(context.Context, MutableGafferService) (GafferService, error)

	// Start a service
	Start(context.Context, uint32) (GafferService, error)
}

GafferClientStub represents a connection to a remote gaffer service

type GafferKernelStub added in v2.0.2

type GafferKernelStub interface {
	gopi.RPCClientStub

	// Ping returns without error if the remote service is running
	Ping(context.Context) error

	// CreateProcess creates a new process from a service and
	// returns a unique process id
	CreateProcess(context.Context, GafferService) (uint32, error)

	// RunProcess runs a created process
	RunProcess(context.Context, uint32) error

	// StopProcess stops a running process
	StopProcess(context.Context, uint32) error

	// Processes returns a filtered set of processes
	Processes(context.Context, uint32) ([]GafferProcess, error)

	// Executables returns the set of executable service names
	Executables(context.Context) ([]string, error)

	// Stream events until cancelled, using a filter
	StreamEvents(context.Context, uint32) error
}

GafferKernelStub represents a connection to a remote kernel service

type GafferProcess added in v2.0.2

type GafferProcess interface {
	Id() uint32
	Service() GafferService
	State() GafferState
}

GafferProcess represents a running process

type GafferService added in v2.0.2

type GafferService interface {
	Name() string
	Sid() uint32
	Path() string
	Cwd() string
	Args() []string
	User() string
	Group() string
	Enabled() bool
}

GafferService represents a service which may or may not be running

type GafferState added in v2.0.2

type GafferState uint
const (
	GAFFER_STATE_NONE GafferState = iota
	GAFFER_STATE_NEW
	GAFFER_STATE_RUNNING
	GAFFER_STATE_STOPPING
	GAFFER_STATE_STOPPED
	GAFFER_STATE_STDOUT
	GAFFER_STATE_STDERR
)

func (GafferState) String added in v2.0.2

func (s GafferState) String() string

type HelloworldStub added in v2.0.2

type HelloworldStub interface {
	gopi.RPCClientStub

	// Ping returns without error if the remote service is running
	Ping(context.Context) error
}

HelloworldStub represents a connection to a remote helloworld service

type MutableGafferService added in v2.0.2

type MutableGafferService interface {
	GafferService

	SetName(string) MutableGafferService
	SetArgs(value []string) MutableGafferService
	SetEnabled(bool) MutableGafferService
}

MutableGafferService represents a service which can have fields updated

Jump to

Keyboard shortcuts

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