Documentation ¶
Index ¶
- Variables
- func AuthenticationMiddleware(checkFunc IntrospectFunc) func(http.Handler) http.Handler
- func GQLHandler(ctx context.Context, usecase usecases.MyCareHub) http.HandlerFunc
- func HealthStatusCheck(w http.ResponseWriter, r *http.Request)
- func PrepareServer(ctx context.Context, port int, allowedOrigins []string) *http.Server
- func Router(ctx context.Context) (*mux.Router, error)
- func UserContextInjectionMiddleware(us IUserProfile) func(http.Handler) http.Handler
- type IUserProfile
- type IntrospectFunc
- type IntrospectResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var AllowedOrigins = []string{
"https://healthcloud.co.ke",
"https://bewell.healthcloud.co.ke",
"http://localhost:5000",
}
AllowedOrigins is list of CORS origins allowed to interact with this service
Functions ¶
func AuthenticationMiddleware ¶
func AuthenticationMiddleware(checkFunc IntrospectFunc) func(http.Handler) http.Handler
AuthenticationMiddleware
func GQLHandler ¶
GQLHandler sets up a GraphQL resolver
func HealthStatusCheck ¶
func HealthStatusCheck(w http.ResponseWriter, r *http.Request)
HealthStatusCheck endpoint to check if the server is working.
func PrepareServer ¶
PrepareServer starts up a server
func UserContextInjectionMiddleware ¶
func UserContextInjectionMiddleware(us IUserProfile) func(http.Handler) http.Handler
UserContextInjectionMiddleware retrieves a logged in user's organisation and program and sets it into context for the request
Types ¶
type IUserProfile ¶
type IUserProfile interface {
GetUserProfile(ctx context.Context, userID string) (*domain.User, error)
}
IUserProfile ...
type IntrospectFunc ¶
type IntrospectFunc func(ctx context.Context, token string) (*IntrospectResponse, error)
type IntrospectResponse ¶
func Introspector ¶
func Introspector(ctx context.Context, token string) (*IntrospectResponse, error)
Click to show internal directories.
Click to hide internal directories.