Documentation ¶
Index ¶
- Constants
- Variables
- type MaxResourceLimits
- type MonitorStreamAdapter
- type Options
- type Server
- func (gr *Server) CancelBuild(ctx context.Context, req *furanrpc.BuildCancelRequest) (_ *furanrpc.BuildCancelResponse, err error)
- func (gr *Server) GetBuildEvents(ctx context.Context, req *furanrpc.BuildStatusRequest) (*furanrpc.BuildEventsResponse, error)
- func (gr *Server) GetBuildStatus(ctx context.Context, req *furanrpc.BuildStatusRequest) (_ *furanrpc.BuildStatusResponse, err error)
- func (gr *Server) ListBuilds(ctx context.Context, req *furanrpc.ListBuildsRequest) (*furanrpc.ListBuildsResponse, error)
- func (gr *Server) Listen(addr string) error
- func (gr *Server) MonitorBuild(req *furanrpc.BuildStatusRequest, ...) error
- func (gr *Server) Shutdown()
- func (gr *Server) StartBuild(ctx context.Context, req *furanrpc.BuildRequest) (*furanrpc.BuildRequestResponse, error)
Constants ¶
const APIKeyLabel = "api_key"
APIKeyLabel is the request metadata label used for the API key
Variables ¶
var DefaultCacheOpts = furanrpc.BuildCacheOpts{ Type: furanrpc.BuildCacheOpts_DISABLED, MaxMode: false, }
DefaultCacheOpts is the cache options that will be used if not overridden in Options
var DefaultJobHandoffTimeout = 5 * time.Minute
DefaultJobHandoffTimeout is the default maximum amount of time we will wait for job handoff to occur once the build job is running
Functions ¶
This section is empty.
Types ¶
type MaxResourceLimits ¶
type MaxResourceLimits struct { MaxCPUReq resource.Quantity MaxMemReq resource.Quantity MaxCPULim resource.Quantity MaxMemLim resource.Quantity }
MaxResourceLimits contains the maximum allowable quantities for build resource requests/limits if supplied in build API requests. If unset, the zero value for any field will result in no allowed build resource overrides for that field in requests. Since build resource requests/limits are optional, this means that only the defaults would be used.
type MonitorStreamAdapter ¶
type MonitorStreamAdapter struct { grpc.ServerStream sync.RWMutex // contains filtered or unexported fields }
MonitorStreamAdapter allows the Monitor streaming RPC to be consumed by non-gRPC clients
func NewMonitorStreamAdapter ¶
func NewMonitorStreamAdapter(ctx context.Context, bufmsgs uint) *MonitorStreamAdapter
NewMonitorStreamAdapter returns a MonitorStreamAdapter
func (*MonitorStreamAdapter) Context ¶
func (msa *MonitorStreamAdapter) Context() context.Context
func (*MonitorStreamAdapter) RecvMsg ¶
func (msa *MonitorStreamAdapter) RecvMsg(m interface{}) error
RecvMsg blocks and listens for *furanrpc.BuildEvent messages and if one is received, assigns it to m and returns a nil error
func (*MonitorStreamAdapter) Send ¶
func (msa *MonitorStreamAdapter) Send(e *furanrpc.BuildEvent) error
func (*MonitorStreamAdapter) SendMsg ¶
func (msa *MonitorStreamAdapter) SendMsg(m interface{}) error
SendMsg sends m (which must be a *furanrpc.BuildEvent) to listeners
type Options ¶
type Options struct { Tracing config.APMConfig // TLSCertificate is the TLS certificate used to secure the gRPC transport. TLSCertificate tls.Certificate // CredentialDecryptionKey is the secretbox key used to decrypt the build github credential CredentialDecryptionKey [32]byte Cache *furanrpc.BuildCacheOpts LogFunc func(msg string, args ...interface{}) JobHandoffTimeout time.Duration MaxResources MaxResourceLimits }
type Server ¶
type Server struct { DL datalayer.DataLayer BM models.BuildManager // CFFactory is a function that returns a CodeFetcher. Token should be considered optional. CFFactory func(token string) models.CodeFetcher Opts *Options // contains filtered or unexported fields }
Server represents an object that responds to gRPC calls
func (*Server) CancelBuild ¶
func (gr *Server) CancelBuild(ctx context.Context, req *furanrpc.BuildCancelRequest) (_ *furanrpc.BuildCancelResponse, err error)
CancelBuild requests cancellation for a currently-running build
func (*Server) GetBuildEvents ¶
func (gr *Server) GetBuildEvents(ctx context.Context, req *furanrpc.BuildStatusRequest) (*furanrpc.BuildEventsResponse, error)
func (*Server) GetBuildStatus ¶
func (gr *Server) GetBuildStatus(ctx context.Context, req *furanrpc.BuildStatusRequest) (_ *furanrpc.BuildStatusResponse, err error)
GetBuildStatus returns the current status for a build
func (*Server) ListBuilds ¶
func (gr *Server) ListBuilds(ctx context.Context, req *furanrpc.ListBuildsRequest) (*furanrpc.ListBuildsResponse, error)
func (*Server) Listen ¶
Listen starts the RPC listener on addr (host:port) and blocks until the server is signalled to stop. Always returns a non-nil error.
func (*Server) MonitorBuild ¶
func (gr *Server) MonitorBuild(req *furanrpc.BuildStatusRequest, stream furanrpc.FuranExecutor_MonitorBuildServer) error
MonitorBuild streams events from a specified build until completion
func (*Server) StartBuild ¶
func (gr *Server) StartBuild(ctx context.Context, req *furanrpc.BuildRequest) (*furanrpc.BuildRequestResponse, error)
StartBuild creates a new asynchronous build job