{"modulePath":"github.com/ericls/imgdd","version":"v0.0.0-20261110025940-bbaddd9beae5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpserver\n\n## Functions\n\n```go\nfunc ExtractIP(req *http.Request) string\n```\n\n```go\nfunc ExtractIPDirect(req *http.Request) string\n```\n\n```go\nfunc ExtractIPXFF(req *http.Request) string\n```\n\n```go\nfunc GetBaseURL(c context.Context) *url.URL\n```\n\n```go\nfunc GetRequest(c context.Context) *http.Request\n```\n\n```go\nfunc GetResponseWriter(c context.Context) http.ResponseWriter\n```\n\n```go\nfunc GracefulServe(srv *http.Server, shutdownTimeout time.Duration) error\n```\n\n```go\nfunc IsHttps(c context.Context) bool\n```\n\n```go\nfunc IsSecure(r *http.Request) bool\n```\n\n```go\nfunc LoggerMiddleware(next http.Handler) http.Handler\n```\n\n```go\nfunc MakeServer(\n\tconf *HttpServerConfigDef,\n\tdbConf *db.DBConfigDef,\n\tstorageConf *storage.StorageConfigDef,\n\temailConf *email.EmailConfigDef,\n\tcleanupConf *storage.CleanupConfig,\n\tdeleteExpiredImagesConf *image.DeleteExpiredImagesConfig,\n) *http.Server\n```\n\n```go\nfunc NewGqlResolver(\n\tdbConn *sql.DB,\n\tidentityManager *IdentityManager,\n\tstorageDefRepo storage.StorageDefRepo,\n\tstoredImageRepo storage.StoredImageRepo,\n\timageRepo image.ImageRepo,\n\timageRelRepo image.ImageRelationshipRepo,\n\timageDomain string,\n\tdefaultURLFormat domainmodels.ImageURLFormat,\n\tgetEmailBackend func(c context.Context) email.EmailBackend,\n\tsecretKey string,\n\tcaptchaClient captcha.CaptchaClient,\n\tallowNewUser bool,\n\timageMaxUploadBytes int64,\n\tguestImageMaxUploadBytes int64,\n) *graph.Resolver\n```\n\n```go\nfunc NewGraphConfig(resolver *graph.Resolver) graph.Config\n```\n\n```go\nfunc ParseOriginList(value string) []string\n```\n\n```go\nfunc RWContextMiddleware(next http.Handler) http.Handler\n```\n\n## Types\n\n```go\ntype ContextKey string\n```\n\n```go\ntype HttpContextUserManager struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewContextUserManager(contextKey string, identityRepo identity.IdentityRepo) *HttpContextUserManager\n```\n\n```go\nfunc (cu *HttpContextUserManager) GetAuthenticationInfo(c context.Context) *identity.AuthenticationInfo\n```\n\n```go\nfunc (cu *HttpContextUserManager) SetAuthenticationInfo(c context.Context, authenticationInfo *identity.AuthenticationInfo)\n```\n\n```go\nfunc (cu *HttpContextUserManager) WithAuthenticationInfo(c context.Context, authenticationInfo *identity.AuthenticationInfo) context.Context\n```\n\n```go\ntype HttpServerConfigDef struct {\n\tBind                     string\n\tWriteTimeout             int\n\tReadTimeout              int\n\tTemplatesFS              fs.FS\n\tStaticFS                 fs.FS\n\tSessionKey               string\n\tRedisURIForSession       string\n\tRedisURI                 string\n\tSiteName                 string\n\tSiteTitle                string\n\tImageDomain              string\n\tWebUIHost                string\n\tDefaultURLFormat         domainmodels.ImageURLFormat\n\tEnableGqlPlayground      bool\n\tEnableSafeImageCheck     bool\n\tSafeImageCheckEndpoint   string\n\tCaptchaProvider          captcha.CaptchaProvider\n\tRecaptchaClientKey       string\n\tTurnstileSiteKey         string\n\tRecaptchaServerKey       string\n\tTurnstileSecretKey       string\n\tCustomCSS                string\n\tCustomJS                 string\n\tGoogleAnalyticsID        string\n\tAllowUpload              bool\n\tAllowNewUser             bool\n\tImageCacheMaxBytes       int64\n\tImageCacheMaxFileBytes   int64\n\tImageMaxUploadBytes      int64\n\tGuestImageMaxUploadBytes int64\n\tWebUIOrigins             []string\n}\n```\n\n```go\nfunc ReadServerConfigFromEnv() HttpServerConfigDef\n```\n\n```go\ntype IdentityManager struct {\n\tIdentityRepo       identity.IdentityRepo\n\tContextUserManager identity.ContextUserManager\n\tPersister          persister.Persister\n}\n```\n\n```go\nfunc NewIdentityManager(identityRepo identity.IdentityRepo, persister persister.Persister) *IdentityManager\n```\n\n```go\nfunc (i *IdentityManager) Authenticate(w http.ResponseWriter, r *http.Request, userId string, organizationUserId string)\n```\n\n```go\nfunc (i *IdentityManager) AuthenticateContext(c context.Context, userId string, organzationUserId string)\n```\n\n```go\nfunc (i *IdentityManager) Logout(w http.ResponseWriter, r *http.Request)\n```\n\n```go\nfunc (i *IdentityManager) LogoutContext(c context.Context)\n```\n\n```go\nfunc (i *IdentityManager) Middleware(next http.Handler) http.Handler\n```\n\n```go\ntype UploadReturn struct {\n\tID         string `json:\"id\"`\n\tFilename   string `json:\"filename\"`\n\tURL        string `json:\"url\"`\n\tIdentifier string `json:\"identifier\"`\n}\n```\n\n","path":"github.com/ericls/imgdd/httpserver","name":"httpserver","synopsis":"","isRedistributable":true}
