domain

package
v1.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package domain provides domain-specific configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentDomainFromContext

func CurrentDomainFromContext(ctx context.Context) string

CurrentDomainFromContext retrieves the current domain from a context set by the middleware.

func Middleware

func Middleware(domains []ConfigItem, domainOverride string) func(next http.Handler) http.Handler

Middleware is a middleware setting domain-specific configuration into the request context.

Types

type ConfigItem

type ConfigItem struct {
	Domains        []string
	AllUsersGroup  int64
	TempUsersGroup int64
}

ConfigItem is one item of the configuration list.

type CtxConfig

type CtxConfig struct {
	AllUsersGroupID  int64
	TempUsersGroupID int64
}

CtxConfig contains domain-specific settings related to a request context.

func ConfigFromContext

func ConfigFromContext(ctx context.Context) *CtxConfig

ConfigFromContext retrieves the current domain configuration from a context set by the middleware.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL