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, ...)
- func IsAuthenticated(next echo.HandlerFunc) echo.HandlerFunc
- type Authenticator
- type Config
- 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) FindOrganization(ctx context.Context, req *adminv1.FindOrganizationRequest) (*adminv1.FindOrganizationResponse, error)
- func (s *Server) FindOrganizations(ctx context.Context, req *adminv1.FindOrganizationsRequest) (*adminv1.FindOrganizationsResponse, error)
- func (s *Server) FindProject(ctx context.Context, req *adminv1.FindProjectRequest) (*adminv1.FindProjectResponse, error)
- func (s *Server) FindProjects(ctx context.Context, req *adminv1.FindProjectsRequest) (*adminv1.FindProjectsResponse, error)
- func (s *Server) HTTPHandler(ctx context.Context) (http.Handler, error)
- func (s *Server) IsAuthenticated1(next http.HandlerFunc) http.HandlerFunc
- func (s *Server) Ping(ctx context.Context, req *adminv1.PingRequest) (*adminv1.PingResponse, 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.
func IsAuthenticated ¶
func IsAuthenticated(next echo.HandlerFunc) echo.HandlerFunc
IsAuthenticated is a middleware that checks if the user has already been authenticated previously.
Types ¶
type Authenticator ¶
Authenticator is used to authenticate our users. Refereance link - https://auth0.com/docs/quickstart/webapp/golang/01-login for sample auth setup.
func (*Authenticator) VerifyIDToken ¶
func (a *Authenticator) VerifyIDToken(ctx context.Context, token *oauth2.Token) (*oidc.IDToken, error)
VerifyIDToken verifies that an *oauth2.Token is a valid *oidc.IDToken.
type Server ¶
type Server struct { adminv1.UnsafeAdminServiceServer // contains filtered or unexported fields }
hi
func (*Server) CreateOrganization ¶
func (s *Server) CreateOrganization(ctx context.Context, req *adminv1.CreateOrganizationRequest) (*adminv1.CreateOrganizationResponse, error)
CreateOrganization implements AdminService. (POST /organizations)
func (*Server) CreateProject ¶
func (s *Server) CreateProject(ctx context.Context, req *adminv1.CreateProjectRequest) (*adminv1.CreateProjectResponse, error)
(POST /v1/organizations/{organization}/projects)
func (*Server) DeleteOrganization ¶
func (s *Server) DeleteOrganization(ctx context.Context, req *adminv1.DeleteOrganizationRequest) (*adminv1.DeleteOrganizationResponse, error)
(DELETE /organizations/{name})
func (*Server) DeleteProject ¶
func (s *Server) DeleteProject(ctx context.Context, req *adminv1.DeleteProjectRequest) (*adminv1.DeleteProjectResponse, error)
(DELETE /v1/organizations/{organization}/project/{name})
func (*Server) FindOrganization ¶
func (s *Server) FindOrganization(ctx context.Context, req *adminv1.FindOrganizationRequest) (*adminv1.FindOrganizationResponse, error)
(GET /organizations/{name})
func (*Server) FindOrganizations ¶
func (s *Server) FindOrganizations(ctx context.Context, req *adminv1.FindOrganizationsRequest) (*adminv1.FindOrganizationsResponse, error)
FindOrganizations implements AdminService. (GET /v1/organizations)
func (*Server) FindProject ¶
func (s *Server) FindProject(ctx context.Context, req *adminv1.FindProjectRequest) (*adminv1.FindProjectResponse, error)
(GET /v1/organizations/{organization}/project/{name})
func (*Server) FindProjects ¶
func (s *Server) FindProjects(ctx context.Context, req *adminv1.FindProjectsRequest) (*adminv1.FindProjectsResponse, error)
FindProjects implements AdminService. (GET /v1/organizations/{organization}/projects)
func (*Server) HTTPHandler ¶ added in v0.21.1
HTTPHandler HTTP handler serving REST gateway.
func (*Server) IsAuthenticated1 ¶ added in v0.21.1
func (s *Server) IsAuthenticated1(next http.HandlerFunc) http.HandlerFunc
IsAuthenticated is a middleware that checks if the user has already been authenticated previously.
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) UpdateOrganization ¶
func (s *Server) UpdateOrganization(ctx context.Context, req *adminv1.UpdateOrganizationRequest) (*adminv1.UpdateOrganizationResponse, error)
(PUT /organizations/{name})
func (*Server) UpdateProject ¶
func (s *Server) UpdateProject(ctx context.Context, req *adminv1.UpdateProjectRequest) (*adminv1.UpdateProjectResponse, error)
(PUT /v1/organizations/{organization}/project/{name})