Documentation
¶
Index ¶
- func ExtractIP(req *http.Request) string
- func ExtractIPDirect(req *http.Request) string
- func ExtractIPXFF(req *http.Request) string
- func GetBaseURL(c context.Context) *url.URL
- func GetRequest(c context.Context) *http.Request
- func GetResponseWriter(c context.Context) http.ResponseWriter
- func GracefulServe(srv *http.Server, shutdownTimeout time.Duration) error
- func IsHttps(c context.Context) bool
- func IsSecure(r *http.Request) bool
- func LoggerMiddleware(next http.Handler) http.Handler
- func MakeServer(conf *HttpServerConfigDef, dbConf *db.DBConfigDef, ...) *http.Server
- func NewGqlResolver(identityManager *IdentityManager, storageDefRepo storage.StorageDefRepo, ...) *graph.Resolver
- func NewGraphConfig(resolver *graph.Resolver) graph.Config
- func RWContextMiddleware(next http.Handler) http.Handler
- type ContextKey
- type HttpContextUserManager
- func (cu *HttpContextUserManager) GetAuthenticationInfo(c context.Context) *identity.AuthenticationInfo
- func (cu *HttpContextUserManager) SetAuthenticationInfo(c context.Context, authenticationInfo *identity.AuthenticationInfo)
- func (cu *HttpContextUserManager) WithAuthenticationInfo(c context.Context, authenticationInfo *identity.AuthenticationInfo) context.Context
- type HttpServerConfigDef
- type IdentityManager
- func (i *IdentityManager) Authenticate(w http.ResponseWriter, r *http.Request, userId string, ...)
- func (i *IdentityManager) AuthenticateContext(c context.Context, userId string, organzationUserId string)
- func (i *IdentityManager) Logout(w http.ResponseWriter, r *http.Request)
- func (i *IdentityManager) LogoutContext(c context.Context)
- func (i *IdentityManager) Middleware(next http.Handler) http.Handler
- type UploadReturn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractIPDirect ¶
func ExtractIPXFF ¶
func GetResponseWriter ¶
func GetResponseWriter(c context.Context) http.ResponseWriter
func MakeServer ¶
func MakeServer( conf *HttpServerConfigDef, dbConf *db.DBConfigDef, storageConf *storage.StorageConfigDef, emailConf *email.EmailConfigDef, cleanupConf *storage.CleanupConfig, ) *http.Server
func NewGqlResolver ¶
func NewGqlResolver( identityManager *IdentityManager, storageDefRepo storage.StorageDefRepo, imageRepo image.ImageRepo, imageDomain string, defaultURLFormat domainmodels.ImageURLFormat, getEmailBackend func(c context.Context) email.EmailBackend, secretKey string, captchaClient captcha.CaptchaClient, allowNewUser bool, ) *graph.Resolver
Types ¶
type ContextKey ¶
type ContextKey string
type HttpContextUserManager ¶
type HttpContextUserManager struct {
// contains filtered or unexported fields
}
func NewContextUserManager ¶
func NewContextUserManager(contextKey string, identityRepo identity.IdentityRepo) *HttpContextUserManager
func (*HttpContextUserManager) GetAuthenticationInfo ¶
func (cu *HttpContextUserManager) GetAuthenticationInfo(c context.Context) *identity.AuthenticationInfo
func (*HttpContextUserManager) SetAuthenticationInfo ¶
func (cu *HttpContextUserManager) SetAuthenticationInfo(c context.Context, authenticationInfo *identity.AuthenticationInfo)
func (*HttpContextUserManager) WithAuthenticationInfo ¶
func (cu *HttpContextUserManager) WithAuthenticationInfo(c context.Context, authenticationInfo *identity.AuthenticationInfo) context.Context
type HttpServerConfigDef ¶
type HttpServerConfigDef struct {
Bind string
WriteTimeout int
ReadTimeout int
TemplatesFS fs.FS
StaticFS fs.FS
SessionKey string
RedisURIForSession string
RedisURI string
SiteName string
SiteTitle string
ImageDomain string
DefaultURLFormat domainmodels.ImageURLFormat
EnableGqlPlayground bool
EnableSafeImageCheck bool
SafeImageCheckEndpoint string
CaptchaProvider captcha.CaptchaProvider
RecaptchaClientKey string
TurnstileSiteKey string
RecaptchaServerKey string
TurnstileSecretKey string
CustomCSS string
CustomJS string
AllowUpload bool
AllowNewUser bool
}
func ReadServerConfigFromEnv ¶
func ReadServerConfigFromEnv() HttpServerConfigDef
type IdentityManager ¶
type IdentityManager struct {
IdentityRepo identity.IdentityRepo
ContextUserManager identity.ContextUserManager
Persister persister.Persister
}
func NewIdentityManager ¶
func NewIdentityManager(identityRepo identity.IdentityRepo, persister persister.Persister) *IdentityManager
func (*IdentityManager) Authenticate ¶
func (i *IdentityManager) Authenticate(w http.ResponseWriter, r *http.Request, userId string, organizationUserId string)
func (*IdentityManager) AuthenticateContext ¶
func (i *IdentityManager) AuthenticateContext(c context.Context, userId string, organzationUserId string)
func (*IdentityManager) Logout ¶
func (i *IdentityManager) Logout(w http.ResponseWriter, r *http.Request)
func (*IdentityManager) LogoutContext ¶
func (i *IdentityManager) LogoutContext(c context.Context)
func (*IdentityManager) Middleware ¶
func (i *IdentityManager) Middleware(next http.Handler) http.Handler
type UploadReturn ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.