Documentation ¶
Index ¶
- Constants
- Variables
- func NewLogger(cfg config.Config) (*zap.Logger, error)
- type Authorization
- type GRPCHandler
- type HTTPHandler
- type HandlerFunc
- type NewServerParams
- type Server
- func (s *Server) AddGRPCHandler(p string, h http.Handler)
- func (s *Server) AddHTTPHandler(method, p string, h HandlerFunc)
- func (s *Server) Address() string
- func (s *Server) EmbeddedFileServer()
- func (s *Server) Init()
- func (s *Server) Interceptors() connect.Option
- func (s *Server) Start() error
- func (s *Server) Stop(ctx context.Context) error
Constants ¶
View Source
const (
RigProjectTokenHeader = "X-Rig-Project-Token"
)
Variables ¶
View Source
var AllUsersAllow = map[string]struct{}{
"/api.v1.authentication.Service": {},
}
View Source
var Module = fx.Module("service", fx.Provide( NewLogger, NewServer, NewAuthorization, ), )
View Source
var OmitAuth = map[string]struct{}{
"/oauth/callback": {},
"/api.v1.authentication.Service/Login": {},
"/api.v1.authentication.Service/Register": {},
"/api.v1.authentication.Service/VerifyEmail": {},
"/api.v1.authentication.Service/RefreshToken": {},
"/api.v1.authentication.Service/OauthCallback": {},
"/api.v1.authentication.Service/SendPasswordReset": {},
"/api.v1.authentication.Service/ResetPassword": {},
"/api.v1.authentication.Service/GetAuthConfig": {},
"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo": {},
"/api/v1/status": {},
}
View Source
var OmitProjectToken = map[string]struct{}{
"/api.v1.project.Service/Use": {},
"/api.v1.project.Service/Create": {},
"/api.v1.project.Service/List": {},
"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo": {},
}
Functions ¶
Types ¶
type Authorization ¶
type Authorization struct {
// contains filtered or unexported fields
}
func NewAuthorization ¶
func NewAuthorization(logger *zap.Logger, as *service_auth.Service) *Authorization
func (*Authorization) Wrap ¶
func (a *Authorization) Wrap(next middleware.MiddlewareHandlerFunc) middleware.MiddlewareHandlerFunc
type GRPCHandler ¶
type HTTPHandler ¶
type HTTPHandler interface {
Build() (string, string, HandlerFunc)
}
type HandlerFunc ¶
type HandlerFunc func(w http.ResponseWriter, r *http.Request) error
type NewServerParams ¶
type NewServerParams struct { fx.In Lifecycle fx.Lifecycle Config config.Config Logger *zap.Logger Authentication *Authorization Telemetry *telemetry.Telemetry GRPCHandlers []GRPCHandler `group:"grpc_handlers"` HTTPHandlers []HTTPHandler `group:"http_handlers"` }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(p NewServerParams) *Server
func (*Server) AddHTTPHandler ¶
func (s *Server) AddHTTPHandler(method, p string, h HandlerFunc)
func (*Server) EmbeddedFileServer ¶
func (s *Server) EmbeddedFileServer()
func (*Server) Interceptors ¶
func (s *Server) Interceptors() connect.Option
Click to show internal directories.
Click to hide internal directories.