systemdutil

package
v7.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2018 License: GPL-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteCommandFromArguments added in v1.0.65

func ExecuteCommandFromArguments(arguments map[string]interface{}) error

ExecuteCommandFromArguments processes the command from the arguments

func ParseServices added in v1.0.65

func ParseServices(ports []string) ([]policy.Service, error)

ParseServices parses strings with the services and returns them in an validated slice

Types

type CLIRequest added in v1.0.65

type CLIRequest struct {
	// Request is the type of the request
	Request RequestType
	// Cgroup is only provided for delete cgroup requests
	Cgroup string
	// Executable is the path to the executable
	Executable string
	// Parameters are the parameters of the executable
	Parameters []string
	// Labels are the user labels attached to the request
	Labels []string
	// ServiceName is a user defined service name
	ServiceName string
	// ServiceID is the ID of the service
	ServiceID string
	// Services are the user defined services (protocol, port)
	Services []policy.Service
	// HostPolicy indicates that this is a host policy
	HostPolicy bool
	// NetworkOnly indicates that the request is only for traffic coming from the network
	NetworkOnly bool
}

CLIRequest captures all CLI parameters

type RequestProcessor added in v1.0.65

type RequestProcessor struct {
	LinuxPath string
	HostPath  string
}

RequestProcessor is an instance of the processor

func NewCustomRequestProcessor added in v1.0.65

func NewCustomRequestProcessor(linux, host string) *RequestProcessor

NewCustomRequestProcessor creates a new request processor

func NewRequestProcessor added in v1.0.65

func NewRequestProcessor() *RequestProcessor

NewRequestProcessor creates a default request processor

func (*RequestProcessor) CreateAndRun added in v1.0.65

func (r *RequestProcessor) CreateAndRun(c *CLIRequest) error

CreateAndRun creates a processing unit

func (*RequestProcessor) Delete added in v1.0.65

func (r *RequestProcessor) Delete(c *CLIRequest) error

Delete will issue a delete command

func (*RequestProcessor) ExecuteRequest added in v1.0.65

func (r *RequestProcessor) ExecuteRequest(c *CLIRequest) error

ExecuteRequest executes the command with an RPC request

func (*RequestProcessor) ParseCommand added in v1.0.65

func (r *RequestProcessor) ParseCommand(arguments map[string]interface{}) (*CLIRequest, error)

ParseCommand parses a command based on the above specification This is a helper function for CLIs like in Trireme Example. Proper use is through the CLIRequest structure

type RequestType added in v1.0.65

type RequestType int

RequestType is the type of the request

const (
	// CreateRequest requests a create event
	CreateRequest RequestType = iota
	// DeleteCgroupRequest requests deletion based on the cgroup - issued by the kernel
	DeleteCgroupRequest
	// DeleteServiceRequest requests deletion by the service ID
	DeleteServiceRequest
)

Jump to

Keyboard shortcuts

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