server

package
v0.1.0-alpha.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2016 License: MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanArgs

type CleanArgs struct {
	NamePattern string
	Age         time.Duration
}

CleanArgs -

type CleanResponse

type CleanResponse struct {
	Cleaned []service.Info
	Failed  []RemoveFailure
}

CleanResponse -

type InfoArgs

type InfoArgs struct {
	Name string
}

InfoArgs -

type InfoResponse

type InfoResponse struct {
	Info service.Info
}

InfoResponse -

type ListArgs

type ListArgs struct {
	// If true, only running services are listed
	Running bool

	// If true, only temporary services are listed
	Temp bool
}

ListArgs -

type ListResponse

type ListResponse struct {
	Services []service.Info
}

ListResponse -

type LoadServicesArgs

type LoadServicesArgs struct {
	ServiceFilePath string
}

LoadServicesArgs -

type LoadServicesResponse

type LoadServicesResponse struct {
	NewServices        []service.Info
	UpdatedServices    []service.Info
	DeprecatedServices []service.Info
	RemovedServices    []string
}

LoadServicesResponse -

type RemoveFailure

type RemoveFailure struct {
	Service service.Info
	Err     string
}

RemoveFailure -

type RunArgs

type RunArgs struct {
	Name       string
	Program    string
	Args       []string
	Dir        string
	Env        map[string]string
	CleanAfter time.Duration
}

RunArgs -

type RunResponse

type RunResponse struct {
	Service service.Info
}

RunResponse -

type Server

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

Server is the backend that manages services

func New

func New() (*Server, <-chan service.Info, error)

New creates a new Server

func (*Server) Clean

func (s *Server) Clean(args CleanArgs, reply *CleanResponse) (err error)

Clean will start a new, temp service

func (*Server) Exit

func (s *Server) Exit(_ bool, _ *bool) (err error)

Exit casues server to exit

func (*Server) Info

func (s *Server) Info(args *InfoArgs, reply *InfoResponse) (err error)

Info gets info about service

func (*Server) Init

func (s *Server) Init(_ bool, _ *bool) error

Init runs the server, listening for RPC calls, blocking until exit

func (*Server) List

func (s *Server) List(args *ListArgs, reply *ListResponse) (err error)

List returns a list of services

func (*Server) LoadServices

func (s *Server) LoadServices(args LoadServicesArgs, reply *LoadServicesResponse) (err error)

LoadServices will start a new, temp service

func (*Server) Run

func (s *Server) Run(args *RunArgs, reply *RunResponse) (err error)

Run will start a new, temp service

func (*Server) Start

func (s *Server) Start(args StartArgs, reply *StartResponse) (err error)

Start runs a service, if it's stopped

func (*Server) Stop

func (s *Server) Stop(args StopArgs, reply *StopResponse) (err error)

Stop stops a service, if it's running

func (*Server) Tail

func (s *Server) Tail(args *TailArgs, reply *TailResponse) (err error)

Tail gets lines of output since a line index for stdout and/or stderr

func (*Server) Version

func (s *Server) Version(_ bool, reply *VersionResponse) (err error)

Version gets the version of the server

func (*Server) Wait

func (s *Server) Wait(args *WaitArgs, reply *WaitResponse) (err error)

Wait blocks until a service stops running

type StartArgs

type StartArgs struct {
	Name string
}

StartArgs -

type StartResponse

type StartResponse struct {
	Info service.Info
}

StartResponse -

type StopArgs

type StopArgs struct {
	Name string

	// Time to wait between escalation signals to the service's process
	EscalationInterval time.Duration
}

StopArgs -

type StopResponse

type StopResponse struct {
	Info service.Info
}

StopResponse -

type TailArgs

type TailArgs struct {
	// Name of service to get output from
	Name string

	// If specified, restrict output to this pid
	Pid int

	// Max num lines to include
	MaxLines int

	// Index to start at, from a previous call, or a negative index to mean
	// that may from the end in reverse.
	Index int

	// If false, whatever output is available will be returned. Otherwise,
	// the call will wait for some output before returning. If pid != 0 and
	// that process is done with output, the call will return, even if there
	// isn't any output, and EOF will be true.
	Follow bool
}

TailArgs -

type TailResponse

type TailResponse struct {
	// Output lines
	Lines []service.OutputLine

	// True if the pid asked for is done outputting. If no pid was given,
	// true if tail has reached end of whatever is currently available.
	EOF bool

	// Index & pid to use for a followup call to resume from the next line
	// of output.
	NextIndex int
	NextPid   int
}

TailResponse -

type VersionResponse

type VersionResponse struct {
	Version semver.Version
}

VersionResponse -

type WaitArgs

type WaitArgs struct {
	Name string
}

WaitArgs -

type WaitResponse

type WaitResponse struct {
	Info service.Info
}

WaitResponse -

Jump to

Keyboard shortcuts

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