import "go.chromium.org/goma/server/backend"
Package backend is goma service backend of /cxx-compiler-service/*.
backend.go ctx.go doc.go error.go exec.go execlog.go file.go grpc.go httprpc.go local.go mixer.go remote.go
type Auth interface { // Auth checks HTTP access, and returns new context with enduser info. Auth(context.Context, *http.Request) (context.Context, error) }
Auth authenticates the request.
type Backend interface { Ping() http.Handler Exec() http.Handler ByteStream() http.Handler StoreFile() http.Handler LookupFile() http.Handler Execlog() http.Handler }
Backend is interface of backend for frontend. TODO: provides switching backend, httprpc backend (e.g. to clients5.google.com/cxx-compiler-service/*) and remote backend (e.g. to <cluster>.endpoints.<project>.cloud.goog)
FromProto creates Backend based on cfg. returned func will release resources associated with Backend.
type ExecServer struct { Client execpb.ExecServiceClient }
ExecServer handles /e.
Exec handles /e.
type ExeclogServer struct { Client execlogpb.LogServiceClient }
ExeclogServer handles /sl.
func (s ExeclogServer) SaveLog(ctx context.Context, req *gomapb.SaveLogReq) (*gomapb.SaveLogResp, error)
SaveLog handles /sl.
type FileServer struct { Client filepb.FileServiceClient }
FileServer handles /s and /l.
func (s FileServer) LookupFile(ctx context.Context, req *gomapb.LookupFileReq) (*gomapb.LookupFileResp, error)
LookupFile handles /l.
func (s FileServer) StoreFile(ctx context.Context, req *gomapb.StoreFileReq) (*gomapb.StoreFileResp, error)
StoreFile handles /s.
type GRPC struct { ExecServer FileServer ExeclogServer ByteStreamClient bspb.ByteStreamClient Auth Auth // api key. used for remote backend. APIKey string // trace prefix and label. used for local backend. Namespace string Cluster string }
GRPC is grpc backend in the same cluster (local) or other cluter (remote).
FromLocalBackend creates new GRPC from cfg. returned func would release resources associated with GRPC.
func FromRemoteBackend(ctx context.Context, cfg *pb.RemoteBackend, opt Option) (GRPC, func(), error)
FromRemoteBackend creates new GRPC from cfg. returned func would release resources associated with GRPC.
ByteStream returns http handler for bytestream.
Exec returns http handler for exec request.
Execlog returns http handler for execlog request.
LookupFile returns http handler for lookup file request.
Ping returns http handler for ping.
StoreFile returns http handler for store file request.
type HTTPRPC struct {
// contains filtered or unexported fields
}
HTTPRPC is httprpc backend.
FromHTTPRPCBackend creates new httprpc backend from cfg.
NewHTTPRPC creates httprpc backend proxies to target (scheme + host). target's path etc will be ignored.
ByteStream forwards requests to target.
Exec forwards requests to target.
Execlog forwards requests to target.
LookupFile forwards requests to target.
Ping forwards requests to target.
StoreFile forwards requests to target.
Mixer is mixer backend, dispatched by group of enduser.
func FromBackendRule(ctx context.Context, cfg *pb.BackendRule, opt Option) (mixer Mixer, cleanup func(), err error)
FromBackendRule creates new Mixer from cfg. returned func would release resources associated with Mixer.
Option is backend option.
Package backend imports 39 packages (graph) and is imported by 1 packages. Updated 2020-10-27. Refresh now. Tools for package owners.