server

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorToCode added in v0.21.1

func ErrorToCode(err error) codes.Code

ErrorToCode maps an error to a gRPC code for logging. It wraps the default behavior and adds handling of context errors.

func GRPCCodeToLevel added in v0.21.1

func GRPCCodeToLevel(code codes.Code) logging.Level

GRPCCodeToLevel overrides the log level of various gRPC codes. We're currently not doing very granular error handling, so we get quite a lot of codes.Unknown errors, which we do not want to emit as error logs.

func HTTPErrorHandler added in v0.21.1

func HTTPErrorHandler(ctx context.Context, mux *gateway.ServeMux, marshaler gateway.Marshaler, w http.ResponseWriter, r *http.Request, err error)

HTTPErrorHandler wraps gateway.DefaultHTTPErrorHandler to map gRPC unknown errors (i.e. errors without an explicit code) to HTTP status code 400 instead of 500.

Types

type Options added in v0.23.0

type Options struct {
	HTTPPort               int
	GRPCPort               int
	ExternalURL            string
	FrontendURL            string
	SessionKeyPairs        [][]byte
	AllowedOrigins         []string
	AuthDomain             string
	AuthClientID           string
	AuthClientSecret       string
	GithubAppName          string
	GithubAppWebhookSecret string
}

type Server

type Server struct {
	adminv1.UnsafeAdminServiceServer
	// contains filtered or unexported fields
}

func New

func New(opts *Options, logger *zap.Logger, adm *admin.Service, issuer *runtimeauth.Issuer) (*Server, error)

func (*Server) CreateProject

func (*Server) DeleteProject

func (*Server) GetCurrentUser added in v0.23.0

func (*Server) GetGithubRepoStatus added in v0.23.0

func (*Server) GetOrganization added in v0.23.0

func (*Server) GetProject added in v0.23.0

func (*Server) HTTPHandler added in v0.21.1

func (s *Server) HTTPHandler(ctx context.Context) (http.Handler, error)

HTTPHandler HTTP handler serving REST gateway.

func (*Server) ListOrganizations added in v0.23.0

func (*Server) ListProjects added in v0.23.0

func (*Server) Ping added in v0.21.1

Ping implements AdminService

func (*Server) RevokeCurrentAuthToken added in v0.23.0

RevokeCurrentAuthToken revokes the current auth token

func (*Server) ServeGRPC added in v0.21.1

func (s *Server) ServeGRPC(ctx context.Context) error

ServeGRPC Starts the gRPC server.

func (*Server) ServeHTTP added in v0.21.1

func (s *Server) ServeHTTP(ctx context.Context) error

Starts the HTTP server.

func (*Server) UpdateProject

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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