rpcclient

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package lib is a generated protocol buffer package.

It is generated from these files:

models.proto

It has these top-level messages:

BuildDefinition
PushRegistryDefinition
PushS3Definition
PushDefinition
BuildRequest
BuildStatusRequest
BuildCancelRequest
BuildRequestResponse
BuildCancelResponse
BuildStatusResponse
BuildEventError
BuildEvent

Index

Constants

This section is empty.

Variables

View Source
var BuildEventError_ErrorType_name = map[int32]string{
	0: "FATAL",
	1: "TEMPORARY",
	2: "NO_ERROR",
}
View Source
var BuildEventError_ErrorType_value = map[string]int32{
	"FATAL":     0,
	"TEMPORARY": 1,
	"NO_ERROR":  2,
}
View Source
var BuildEvent_EventType_name = map[int32]string{
	0: "DOCKER_BUILD_STREAM",
	1: "DOCKER_PUSH_STREAM",
	2: "LOG",
}
View Source
var BuildEvent_EventType_value = map[string]int32{
	"DOCKER_BUILD_STREAM": 0,
	"DOCKER_PUSH_STREAM":  1,
	"LOG":                 2,
}
View Source
var BuildStatusResponse_BuildState_name = map[int32]string{
	0: "STARTED",
	1: "BUILDING",
	2: "PUSHING",
	3: "SUCCESS",
	4: "BUILD_FAILURE",
	5: "PUSH_FAILURE",
	6: "NOT_NECESSARY",
}
View Source
var BuildStatusResponse_BuildState_value = map[string]int32{
	"STARTED":       0,
	"BUILDING":      1,
	"PUSHING":       2,
	"SUCCESS":       3,
	"BUILD_FAILURE": 4,
	"PUSH_FAILURE":  5,
	"NOT_NECESSARY": 6,
}
View Source
var ErrCanceled = errors.New("build canceled")

ErrCanceled is an error returned by Build() when the build has been canceled

Functions

func RegisterFuranExecutorServer

func RegisterFuranExecutorServer(s *grpc.Server, srv FuranExecutorServer)

Types

type BuildCancelRequest

type BuildCancelRequest struct {
	BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId" json:"build_id,omitempty"`
}

func (*BuildCancelRequest) Descriptor

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

func (*BuildCancelRequest) GetBuildId

func (m *BuildCancelRequest) GetBuildId() string

func (*BuildCancelRequest) ProtoMessage

func (*BuildCancelRequest) ProtoMessage()

func (*BuildCancelRequest) Reset

func (m *BuildCancelRequest) Reset()

func (*BuildCancelRequest) String

func (m *BuildCancelRequest) String() string

type BuildCancelResponse

type BuildCancelResponse struct {
	BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId" json:"build_id,omitempty"`
}

func (*BuildCancelResponse) Descriptor

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

func (*BuildCancelResponse) GetBuildId

func (m *BuildCancelResponse) GetBuildId() string

func (*BuildCancelResponse) ProtoMessage

func (*BuildCancelResponse) ProtoMessage()

func (*BuildCancelResponse) Reset

func (m *BuildCancelResponse) Reset()

func (*BuildCancelResponse) String

func (m *BuildCancelResponse) String() string

type BuildDefinition

type BuildDefinition struct {
	GithubRepo       string            `protobuf:"bytes,1,opt,name=github_repo,json=githubRepo" json:"github_repo,omitempty"`
	DockerfilePath   string            `protobuf:"bytes,2,opt,name=dockerfile_path,json=dockerfilePath" json:"dockerfile_path,omitempty"`
	Ref              string            `protobuf:"bytes,3,opt,name=ref" json:"ref,omitempty"`
	Tags             []string          `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"`
	TagWithCommitSha bool              `protobuf:"varint,5,opt,name=tag_with_commit_sha,json=tagWithCommitSha" json:"tag_with_commit_sha,omitempty"`
	Args             map[string]string `` /* 128-byte string literal not displayed */
}

func (*BuildDefinition) Descriptor

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

func (*BuildDefinition) GetArgs

func (m *BuildDefinition) GetArgs() map[string]string

func (*BuildDefinition) GetDockerfilePath

func (m *BuildDefinition) GetDockerfilePath() string

func (*BuildDefinition) GetGithubRepo

func (m *BuildDefinition) GetGithubRepo() string

func (*BuildDefinition) GetRef

func (m *BuildDefinition) GetRef() string

func (*BuildDefinition) GetTagWithCommitSha

func (m *BuildDefinition) GetTagWithCommitSha() bool

func (*BuildDefinition) GetTags

func (m *BuildDefinition) GetTags() []string

func (*BuildDefinition) ProtoMessage

func (*BuildDefinition) ProtoMessage()

func (*BuildDefinition) Reset

func (m *BuildDefinition) Reset()

func (*BuildDefinition) String

func (m *BuildDefinition) String() string

type BuildEvent

type BuildEvent struct {
	EventError    *BuildEventError     `protobuf:"bytes,1,opt,name=event_error,json=eventError" json:"event_error,omitempty"`
	EventType     BuildEvent_EventType `protobuf:"varint,2,opt,name=event_type,json=eventType,enum=lib.BuildEvent_EventType" json:"event_type,omitempty"`
	BuildId       string               `protobuf:"bytes,3,opt,name=build_id,json=buildId" json:"build_id,omitempty"`
	Message       string               `protobuf:"bytes,4,opt,name=message" json:"message,omitempty"`
	BuildFinished bool                 `protobuf:"varint,5,opt,name=build_finished,json=buildFinished" json:"build_finished,omitempty"`
}

func (*BuildEvent) Descriptor

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

func (*BuildEvent) GetBuildFinished

func (m *BuildEvent) GetBuildFinished() bool

func (*BuildEvent) GetBuildId

func (m *BuildEvent) GetBuildId() string

func (*BuildEvent) GetEventError

func (m *BuildEvent) GetEventError() *BuildEventError

func (*BuildEvent) GetEventType

func (m *BuildEvent) GetEventType() BuildEvent_EventType

func (*BuildEvent) GetMessage

func (m *BuildEvent) GetMessage() string

func (*BuildEvent) ProtoMessage

func (*BuildEvent) ProtoMessage()

func (*BuildEvent) Reset

func (m *BuildEvent) Reset()

func (*BuildEvent) String

func (m *BuildEvent) String() string

type BuildEventError

type BuildEventError struct {
	IsError   bool                      `protobuf:"varint,1,opt,name=is_error,json=isError" json:"is_error,omitempty"`
	ErrorType BuildEventError_ErrorType `protobuf:"varint,2,opt,name=error_type,json=errorType,enum=lib.BuildEventError_ErrorType" json:"error_type,omitempty"`
}

func (*BuildEventError) Descriptor

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

func (*BuildEventError) GetErrorType

func (m *BuildEventError) GetErrorType() BuildEventError_ErrorType

func (*BuildEventError) GetIsError

func (m *BuildEventError) GetIsError() bool

func (*BuildEventError) ProtoMessage

func (*BuildEventError) ProtoMessage()

func (*BuildEventError) Reset

func (m *BuildEventError) Reset()

func (*BuildEventError) String

func (m *BuildEventError) String() string

type BuildEventError_ErrorType

type BuildEventError_ErrorType int32
const (
	BuildEventError_FATAL     BuildEventError_ErrorType = 0
	BuildEventError_TEMPORARY BuildEventError_ErrorType = 1
	BuildEventError_NO_ERROR  BuildEventError_ErrorType = 2
)

func (BuildEventError_ErrorType) EnumDescriptor

func (BuildEventError_ErrorType) EnumDescriptor() ([]byte, []int)

func (BuildEventError_ErrorType) String

func (x BuildEventError_ErrorType) String() string

type BuildEvent_EventType

type BuildEvent_EventType int32
const (
	BuildEvent_DOCKER_BUILD_STREAM BuildEvent_EventType = 0
	BuildEvent_DOCKER_PUSH_STREAM  BuildEvent_EventType = 1
	BuildEvent_LOG                 BuildEvent_EventType = 2
)

func (BuildEvent_EventType) EnumDescriptor

func (BuildEvent_EventType) EnumDescriptor() ([]byte, []int)

func (BuildEvent_EventType) String

func (x BuildEvent_EventType) String() string

type BuildRequest

type BuildRequest struct {
	Build        *BuildDefinition `protobuf:"bytes,1,opt,name=build" json:"build,omitempty"`
	Push         *PushDefinition  `protobuf:"bytes,2,opt,name=push" json:"push,omitempty"`
	SkipIfExists bool             `protobuf:"varint,3,opt,name=skip_if_exists,json=skipIfExists" json:"skip_if_exists,omitempty"`
}

func (*BuildRequest) Descriptor

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

func (*BuildRequest) GetBuild

func (m *BuildRequest) GetBuild() *BuildDefinition

func (*BuildRequest) GetPush

func (m *BuildRequest) GetPush() *PushDefinition

func (*BuildRequest) GetSkipIfExists

func (m *BuildRequest) GetSkipIfExists() bool

func (*BuildRequest) ProtoMessage

func (*BuildRequest) ProtoMessage()

func (*BuildRequest) Reset

func (m *BuildRequest) Reset()

func (*BuildRequest) String

func (m *BuildRequest) String() string

type BuildRequestResponse

type BuildRequestResponse struct {
	BuildId string `protobuf:"bytes,2,opt,name=build_id,json=buildId" json:"build_id,omitempty"`
}

func (*BuildRequestResponse) Descriptor

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

func (*BuildRequestResponse) GetBuildId

func (m *BuildRequestResponse) GetBuildId() string

func (*BuildRequestResponse) ProtoMessage

func (*BuildRequestResponse) ProtoMessage()

func (*BuildRequestResponse) Reset

func (m *BuildRequestResponse) Reset()

func (*BuildRequestResponse) String

func (m *BuildRequestResponse) String() string

type BuildStatusRequest

type BuildStatusRequest struct {
	BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId" json:"build_id,omitempty"`
}

func (*BuildStatusRequest) Descriptor

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

func (*BuildStatusRequest) GetBuildId

func (m *BuildStatusRequest) GetBuildId() string

func (*BuildStatusRequest) ProtoMessage

func (*BuildStatusRequest) ProtoMessage()

func (*BuildStatusRequest) Reset

func (m *BuildStatusRequest) Reset()

func (*BuildStatusRequest) String

func (m *BuildStatusRequest) String() string

type BuildStatusResponse

type BuildStatusResponse struct {
	BuildId      string                         `protobuf:"bytes,1,opt,name=build_id,json=buildId" json:"build_id,omitempty"`
	BuildRequest *BuildRequest                  `protobuf:"bytes,2,opt,name=build_request,json=buildRequest" json:"build_request,omitempty"`
	State        BuildStatusResponse_BuildState `protobuf:"varint,3,opt,name=state,enum=lib.BuildStatusResponse_BuildState" json:"state,omitempty"`
	Finished     bool                           `protobuf:"varint,4,opt,name=finished" json:"finished,omitempty"`
	Failed       bool                           `protobuf:"varint,5,opt,name=failed" json:"failed,omitempty"`
	Cancelled    bool                           `protobuf:"varint,6,opt,name=cancelled" json:"cancelled,omitempty"`
	Started      string                         `protobuf:"bytes,7,opt,name=started" json:"started,omitempty"`
	Completed    string                         `protobuf:"bytes,8,opt,name=completed" json:"completed,omitempty"`
	Duration     float64                        `protobuf:"fixed64,9,opt,name=duration" json:"duration,omitempty"`
}

func (*BuildStatusResponse) Descriptor

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

func (*BuildStatusResponse) GetBuildId

func (m *BuildStatusResponse) GetBuildId() string

func (*BuildStatusResponse) GetBuildRequest

func (m *BuildStatusResponse) GetBuildRequest() *BuildRequest

func (*BuildStatusResponse) GetCancelled

func (m *BuildStatusResponse) GetCancelled() bool

func (*BuildStatusResponse) GetCompleted

func (m *BuildStatusResponse) GetCompleted() string

func (*BuildStatusResponse) GetDuration

func (m *BuildStatusResponse) GetDuration() float64

func (*BuildStatusResponse) GetFailed

func (m *BuildStatusResponse) GetFailed() bool

func (*BuildStatusResponse) GetFinished

func (m *BuildStatusResponse) GetFinished() bool

func (*BuildStatusResponse) GetStarted

func (m *BuildStatusResponse) GetStarted() string

func (*BuildStatusResponse) GetState

func (*BuildStatusResponse) ProtoMessage

func (*BuildStatusResponse) ProtoMessage()

func (*BuildStatusResponse) Reset

func (m *BuildStatusResponse) Reset()

func (*BuildStatusResponse) String

func (m *BuildStatusResponse) String() string

type BuildStatusResponse_BuildState

type BuildStatusResponse_BuildState int32
const (
	BuildStatusResponse_STARTED       BuildStatusResponse_BuildState = 0
	BuildStatusResponse_BUILDING      BuildStatusResponse_BuildState = 1
	BuildStatusResponse_PUSHING       BuildStatusResponse_BuildState = 2
	BuildStatusResponse_SUCCESS       BuildStatusResponse_BuildState = 3
	BuildStatusResponse_BUILD_FAILURE BuildStatusResponse_BuildState = 4
	BuildStatusResponse_PUSH_FAILURE  BuildStatusResponse_BuildState = 5
	BuildStatusResponse_NOT_NECESSARY BuildStatusResponse_BuildState = 6
)

func (BuildStatusResponse_BuildState) EnumDescriptor

func (BuildStatusResponse_BuildState) EnumDescriptor() ([]byte, []int)

func (BuildStatusResponse_BuildState) String

type DiscoveryOptions

type DiscoveryOptions struct {
	UseConsul         bool                  // Whether to use Consul service discovery
	ConsulAddr        string                // Consul address to use (defaults to '127.0.0.1:8500')
	SelectionStrategy NodeSelectionStrategy // If UseConsul is true, this specifies the strategy for node selection
	ServiceName       string                // Required if UseConsul is true
	NodeList          []string              // Required if UseConsul is false. Nodes in the format "{host}:{port}". A random host will be used if len(NodeList) > 1
}

DiscoveryOptions describes the options for determining the Furan node to use for the client.

type FakeClientBuilderFunc

type FakeClientBuilderFunc func() (*BuildEvent, error)

FakeClientBuilderFunc is a function that produces BuildEvents that are passed to the out channel. Return an error to abort the build. or io.EOF to gracefully signal the build is finished successfully.

type FakeFuranClient

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

FakeFuranClient is fake client for testing

func NewFakeFuranClient

func NewFakeFuranClient(bf FakeClientBuilderFunc) (*FakeFuranClient, error)

NewFakeFuranClient returns a FakeFuranClient using bf and vf

func (*FakeFuranClient) Build

func (ffc *FakeFuranClient) Build(ctx context.Context, out chan *BuildEvent, req *BuildRequest) (string, error)

Build performs a fake build, writing fake build events using FakeClientBuilderFunc to out.

type FuranClient

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

FuranClient is an object which issues remote RPC calls to a Furan server

func NewFuranClient

func NewFuranClient(opts *DiscoveryOptions, logger *log.Logger, datadogServiceNamePrefix string) (*FuranClient, error)

NewFuranClient takes a Consul service name and returns a client which connects to a randomly chosen Furan host and uses the optional logger

func (FuranClient) Build

func (fc FuranClient) Build(ctx context.Context, out chan *BuildEvent, req *BuildRequest) (_ string, err error)

Build starts and monitors a build synchronously, sending BuildEvents to out and returning the build ID when completed, or error. Returns an error if there was an RPC error or if the build/push fails You must read from out (or provide a sufficiently buffered channel) to prevent Build from blocking forever

type FuranExecutorClient

type FuranExecutorClient interface {
	StartBuild(ctx context.Context, in *BuildRequest, opts ...grpc.CallOption) (*BuildRequestResponse, error)
	GetBuildStatus(ctx context.Context, in *BuildStatusRequest, opts ...grpc.CallOption) (*BuildStatusResponse, error)
	MonitorBuild(ctx context.Context, in *BuildStatusRequest, opts ...grpc.CallOption) (FuranExecutor_MonitorBuildClient, error)
	CancelBuild(ctx context.Context, in *BuildCancelRequest, opts ...grpc.CallOption) (*BuildCancelResponse, error)
}

func NewFuranExecutorClient

func NewFuranExecutorClient(cc *grpc.ClientConn) FuranExecutorClient

type FuranExecutor_MonitorBuildClient

type FuranExecutor_MonitorBuildClient interface {
	Recv() (*BuildEvent, error)
	grpc.ClientStream
}

type FuranExecutor_MonitorBuildServer

type FuranExecutor_MonitorBuildServer interface {
	Send(*BuildEvent) error
	grpc.ServerStream
}

type ImageBuildPusher

type ImageBuildPusher interface {
	Build(context.Context, chan *BuildEvent, *BuildRequest) (string, error)
}

ImageBuildPusher describes an object capable of building and pushing container images

type NodeSelectionStrategy

type NodeSelectionStrategy int

NodeSelectionStrategy enumerates the ways that rpcclient will use to pick a node

const (
	RandomNodeSelection NodeSelectionStrategy = iota // Choose a random node
	NetworkProximity                                 // Pick the closest node as determined by Consul
)

func (NodeSelectionStrategy) String

func (i NodeSelectionStrategy) String() string

type PushDefinition

type PushDefinition struct {
	Registry *PushRegistryDefinition `protobuf:"bytes,1,opt,name=registry" json:"registry,omitempty"`
	S3       *PushS3Definition       `protobuf:"bytes,2,opt,name=s3" json:"s3,omitempty"`
}

func (*PushDefinition) Descriptor

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

func (*PushDefinition) GetRegistry

func (m *PushDefinition) GetRegistry() *PushRegistryDefinition

func (*PushDefinition) GetS3

func (m *PushDefinition) GetS3() *PushS3Definition

func (*PushDefinition) ProtoMessage

func (*PushDefinition) ProtoMessage()

func (*PushDefinition) Reset

func (m *PushDefinition) Reset()

func (*PushDefinition) String

func (m *PushDefinition) String() string

type PushRegistryDefinition

type PushRegistryDefinition struct {
	Repo string `protobuf:"bytes,1,opt,name=repo" json:"repo,omitempty"`
}

func (*PushRegistryDefinition) Descriptor

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

func (*PushRegistryDefinition) GetRepo

func (m *PushRegistryDefinition) GetRepo() string

func (*PushRegistryDefinition) ProtoMessage

func (*PushRegistryDefinition) ProtoMessage()

func (*PushRegistryDefinition) Reset

func (m *PushRegistryDefinition) Reset()

func (*PushRegistryDefinition) String

func (m *PushRegistryDefinition) String() string

type PushS3Definition

type PushS3Definition struct {
	Region    string `protobuf:"bytes,1,opt,name=region" json:"region,omitempty"`
	Bucket    string `protobuf:"bytes,2,opt,name=bucket" json:"bucket,omitempty"`
	KeyPrefix string `protobuf:"bytes,3,opt,name=key_prefix,json=keyPrefix" json:"key_prefix,omitempty"`
}

func (*PushS3Definition) Descriptor

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

func (*PushS3Definition) GetBucket

func (m *PushS3Definition) GetBucket() string

func (*PushS3Definition) GetKeyPrefix

func (m *PushS3Definition) GetKeyPrefix() string

func (*PushS3Definition) GetRegion

func (m *PushS3Definition) GetRegion() string

func (*PushS3Definition) ProtoMessage

func (*PushS3Definition) ProtoMessage()

func (*PushS3Definition) Reset

func (m *PushS3Definition) Reset()

func (*PushS3Definition) String

func (m *PushS3Definition) String() string

Jump to

Keyboard shortcuts

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