Documentation
¶
Index ¶
- func ErrorToCode(err error) codes.Code
- func GRPCCodeToLevel(code codes.Code) logging.Level
- func HTTPErrorHandler(ctx context.Context, mux *gateway.ServeMux, marshaler gateway.Marshaler, ...)
- type Options
- type Server
- func (s *Server) CreateOrganization(ctx context.Context, req *adminv1.CreateOrganizationRequest) (*adminv1.CreateOrganizationResponse, error)
- func (s *Server) CreateProject(ctx context.Context, req *adminv1.CreateProjectRequest) (*adminv1.CreateProjectResponse, error)
- func (s *Server) DeleteOrganization(ctx context.Context, req *adminv1.DeleteOrganizationRequest) (*adminv1.DeleteOrganizationResponse, error)
- func (s *Server) DeleteProject(ctx context.Context, req *adminv1.DeleteProjectRequest) (*adminv1.DeleteProjectResponse, error)
- func (s *Server) GetCurrentUser(ctx context.Context, req *adminv1.GetCurrentUserRequest) (*adminv1.GetCurrentUserResponse, error)
- func (s *Server) GetGithubRepoStatus(ctx context.Context, req *adminv1.GetGithubRepoStatusRequest) (*adminv1.GetGithubRepoStatusResponse, error)
- func (s *Server) GetOrganization(ctx context.Context, req *adminv1.GetOrganizationRequest) (*adminv1.GetOrganizationResponse, error)
- func (s *Server) GetProject(ctx context.Context, req *adminv1.GetProjectRequest) (*adminv1.GetProjectResponse, error)
- func (s *Server) HTTPHandler(ctx context.Context) (http.Handler, error)
- func (s *Server) ListOrganizations(ctx context.Context, req *adminv1.ListOrganizationsRequest) (*adminv1.ListOrganizationsResponse, error)
- func (s *Server) ListProjects(ctx context.Context, req *adminv1.ListProjectsRequest) (*adminv1.ListProjectsResponse, error)
- func (s *Server) Ping(ctx context.Context, req *adminv1.PingRequest) (*adminv1.PingResponse, error)
- func (s *Server) RevokeCurrentAuthToken(ctx context.Context, req *adminv1.RevokeCurrentAuthTokenRequest) (*adminv1.RevokeCurrentAuthTokenResponse, error)
- func (s *Server) ServeGRPC(ctx context.Context) error
- func (s *Server) ServeHTTP(ctx context.Context) error
- func (s *Server) UpdateOrganization(ctx context.Context, req *adminv1.UpdateOrganizationRequest) (*adminv1.UpdateOrganizationResponse, error)
- func (s *Server) UpdateProject(ctx context.Context, req *adminv1.UpdateProjectRequest) (*adminv1.UpdateProjectResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorToCode ¶ added in v0.21.1
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
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 Server ¶
type Server struct { adminv1.UnsafeAdminServiceServer // contains filtered or unexported fields }
func (*Server) CreateOrganization ¶
func (s *Server) CreateOrganization(ctx context.Context, req *adminv1.CreateOrganizationRequest) (*adminv1.CreateOrganizationResponse, error)
func (*Server) CreateProject ¶
func (s *Server) CreateProject(ctx context.Context, req *adminv1.CreateProjectRequest) (*adminv1.CreateProjectResponse, error)
func (*Server) DeleteOrganization ¶
func (s *Server) DeleteOrganization(ctx context.Context, req *adminv1.DeleteOrganizationRequest) (*adminv1.DeleteOrganizationResponse, error)
func (*Server) DeleteProject ¶
func (s *Server) DeleteProject(ctx context.Context, req *adminv1.DeleteProjectRequest) (*adminv1.DeleteProjectResponse, error)
func (*Server) GetCurrentUser ¶ added in v0.23.0
func (s *Server) GetCurrentUser(ctx context.Context, req *adminv1.GetCurrentUserRequest) (*adminv1.GetCurrentUserResponse, error)
func (*Server) GetGithubRepoStatus ¶ added in v0.23.0
func (s *Server) GetGithubRepoStatus(ctx context.Context, req *adminv1.GetGithubRepoStatusRequest) (*adminv1.GetGithubRepoStatusResponse, error)
func (*Server) GetOrganization ¶ added in v0.23.0
func (s *Server) GetOrganization(ctx context.Context, req *adminv1.GetOrganizationRequest) (*adminv1.GetOrganizationResponse, error)
func (*Server) GetProject ¶ added in v0.23.0
func (s *Server) GetProject(ctx context.Context, req *adminv1.GetProjectRequest) (*adminv1.GetProjectResponse, error)
func (*Server) HTTPHandler ¶ added in v0.21.1
HTTPHandler HTTP handler serving REST gateway.
func (*Server) ListOrganizations ¶ added in v0.23.0
func (s *Server) ListOrganizations(ctx context.Context, req *adminv1.ListOrganizationsRequest) (*adminv1.ListOrganizationsResponse, error)
func (*Server) ListProjects ¶ added in v0.23.0
func (s *Server) ListProjects(ctx context.Context, req *adminv1.ListProjectsRequest) (*adminv1.ListProjectsResponse, error)
func (*Server) Ping ¶ added in v0.21.1
func (s *Server) Ping(ctx context.Context, req *adminv1.PingRequest) (*adminv1.PingResponse, error)
Ping implements AdminService
func (*Server) RevokeCurrentAuthToken ¶ added in v0.23.0
func (s *Server) RevokeCurrentAuthToken(ctx context.Context, req *adminv1.RevokeCurrentAuthTokenRequest) (*adminv1.RevokeCurrentAuthTokenResponse, error)
RevokeCurrentAuthToken revokes the current auth token
func (*Server) UpdateOrganization ¶
func (s *Server) UpdateOrganization(ctx context.Context, req *adminv1.UpdateOrganizationRequest) (*adminv1.UpdateOrganizationResponse, error)
func (*Server) UpdateProject ¶
func (s *Server) UpdateProject(ctx context.Context, req *adminv1.UpdateProjectRequest) (*adminv1.UpdateProjectResponse, error)
Click to show internal directories.
Click to hide internal directories.