api

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2016 License: Apache-2.0 Imports: 11 Imported by: 3 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api is a generated protocol buffer package.

It is generated from these files:

request.proto
result.proto

It has these top-level messages:

EnvVar
ExecRequest
ExecResult

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthRequest = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRequest   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthResult = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowResult   = fmt.Errorf("proto: integer overflow")
)

Functions

This section is empty.

Types

type BlockingDriver

type BlockingDriver struct{}

BlockingDriver executes requests one-at-a-time

func (BlockingDriver) Run

func (bd BlockingDriver) Run(request *ExecRequest) (ExecResult, error)

type Decoder

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

Decoder reads data via protocol.Reader, gob decodes the payload, and returns the result

func WrapDecoder

func WrapDecoder(r io.Reader) Decoder

WrapDecoder configures a Decoder and Reader instance around a base io.Reader

func (Decoder) DecodeRequest

func (d Decoder) DecodeRequest(request *ExecRequest) error

DecodeRequest reads and decodes ExecRequests

func (Decoder) DecodeResult

func (d Decoder) DecodeResult(result *ExecResult) error

DecodeResult reads and decodes ExecResults

type Driver

type Driver interface {
	Run(*ExecRequest) (ExecResult, error)
}

Driver is the command execution interface

type Encoder

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

Encoder takes arbitrary Go data, gob encodes it, and uses protocol.Writer to write the resulting data

func WrapEncoder

func WrapEncoder(w io.Writer) Encoder

Encoder configures an Encoder and Writer instance around a base io.Writer

func (Encoder) EncodeRequest

func (e Encoder) EncodeRequest(request *ExecRequest) error

EncodeRequest encodes ExecRequests and writes them to the underlying transport via protocol.Writer

func (Encoder) EncodeResult

func (e Encoder) EncodeResult(result *ExecResult) error

EncodeResult encodes ExecResults and writes them to the underlying transport via protcol.Writer

type EnvVar added in v0.9.0

type EnvVar struct {
	Name  *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
	Value *string `protobuf:"bytes,2,req,name=value" json:"value,omitempty"`
}

func (*EnvVar) Descriptor added in v0.9.0

func (*EnvVar) Descriptor() ([]byte, []int)

func (*EnvVar) GetName added in v0.9.0

func (m *EnvVar) GetName() string

func (*EnvVar) GetValue added in v0.9.0

func (m *EnvVar) GetValue() string

func (*EnvVar) Marshal added in v0.9.0

func (m *EnvVar) Marshal() (data []byte, err error)

func (*EnvVar) MarshalTo added in v0.9.0

func (m *EnvVar) MarshalTo(data []byte) (int, error)

func (*EnvVar) ProtoMessage added in v0.9.0

func (*EnvVar) ProtoMessage()

func (*EnvVar) Reset added in v0.9.0

func (m *EnvVar) Reset()

func (*EnvVar) Size added in v0.9.0

func (m *EnvVar) Size() (n int)

func (*EnvVar) String added in v0.9.0

func (m *EnvVar) String() string

func (*EnvVar) Unmarshal added in v0.9.0

func (m *EnvVar) Unmarshal(data []byte) error

type ExecRequest

type ExecRequest struct {
	Executable *string   `protobuf:"bytes,1,req,name=executable" json:"executable,omitempty"`
	Die        *bool     `protobuf:"varint,2,opt,name=die" json:"die,omitempty"`
	Stdin      []byte    `protobuf:"bytes,3,opt,name=stdin" json:"stdin,omitempty"`
	Env        []*EnvVar `protobuf:"bytes,4,rep,name=env" json:"env,omitempty"`
}

func NewExecRequest

func NewExecRequest() *ExecRequest

func (*ExecRequest) DelEnv added in v0.9.0

func (er *ExecRequest) DelEnv(name string)

func (*ExecRequest) Descriptor added in v0.9.0

func (*ExecRequest) Descriptor() ([]byte, []int)

func (*ExecRequest) FindEnv added in v0.9.0

func (er *ExecRequest) FindEnv(name string) string

func (*ExecRequest) GetDie added in v0.9.0

func (m *ExecRequest) GetDie() bool

func (*ExecRequest) GetEnv added in v0.9.0

func (m *ExecRequest) GetEnv() []*EnvVar

func (*ExecRequest) GetExecutable added in v0.9.0

func (m *ExecRequest) GetExecutable() string

func (*ExecRequest) GetStdin added in v0.9.0

func (m *ExecRequest) GetStdin() []byte

func (*ExecRequest) Marshal added in v0.9.0

func (m *ExecRequest) Marshal() (data []byte, err error)

func (*ExecRequest) MarshalTo added in v0.9.0

func (m *ExecRequest) MarshalTo(data []byte) (int, error)

func (*ExecRequest) ProtoMessage added in v0.9.0

func (*ExecRequest) ProtoMessage()

func (*ExecRequest) PutEnv added in v0.9.0

func (er *ExecRequest) PutEnv(name, value string)

func (*ExecRequest) Reset added in v0.9.0

func (m *ExecRequest) Reset()

func (*ExecRequest) SetExecutable added in v0.9.0

func (er *ExecRequest) SetExecutable(name string)

func (*ExecRequest) Size added in v0.9.0

func (m *ExecRequest) Size() (n int)

func (*ExecRequest) String added in v0.9.0

func (m *ExecRequest) String() string

func (*ExecRequest) ToExecCommand

func (er *ExecRequest) ToExecCommand() exec.Cmd

ToExecCommand builds a Go os/exec.Cmd from a source ExecRequest

func (*ExecRequest) Unmarshal added in v0.9.0

func (m *ExecRequest) Unmarshal(data []byte) error

type ExecResult

type ExecResult struct {
	Stdout  []byte `protobuf:"bytes,1,opt,name=stdout" json:"stdout,omitempty"`
	Stderr  []byte `protobuf:"bytes,2,opt,name=stderr" json:"stderr,omitempty"`
	Success *bool  `protobuf:"varint,3,req,name=success" json:"success,omitempty"`
	Elapsed *int64 `protobuf:"varint,4,req,name=elapsed" json:"elapsed,omitempty"`
}

func (*ExecResult) Descriptor added in v0.9.0

func (*ExecResult) Descriptor() ([]byte, []int)

func (*ExecResult) GetElapsed added in v0.9.0

func (m *ExecResult) GetElapsed() int64

func (*ExecResult) GetStderr added in v0.9.0

func (m *ExecResult) GetStderr() []byte

func (*ExecResult) GetStdout added in v0.9.0

func (m *ExecResult) GetStdout() []byte

func (*ExecResult) GetSuccess added in v0.9.0

func (m *ExecResult) GetSuccess() bool

func (*ExecResult) Marshal added in v0.9.0

func (m *ExecResult) Marshal() (data []byte, err error)

func (*ExecResult) MarshalTo added in v0.9.0

func (m *ExecResult) MarshalTo(data []byte) (int, error)

func (*ExecResult) ProtoMessage added in v0.9.0

func (*ExecResult) ProtoMessage()

func (*ExecResult) Reset added in v0.9.0

func (m *ExecResult) Reset()

func (*ExecResult) SetElapsed added in v0.9.0

func (er *ExecResult) SetElapsed(elapsed time.Duration)

func (*ExecResult) SetSuccess added in v0.9.0

func (er *ExecResult) SetSuccess(flag bool)

func (*ExecResult) Size added in v0.9.0

func (m *ExecResult) Size() (n int)

func (*ExecResult) String added in v0.9.0

func (m *ExecResult) String() string

func (*ExecResult) Unmarshal added in v0.9.0

func (m *ExecResult) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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