Documentation ¶
Index ¶
- type CorsObject
- func (cors *CorsObject) Child(childsrc ...string) *CorsObject
- func (cors *CorsObject) Connect(connectsrc ...string) *CorsObject
- func (cors *CorsObject) Embedder(e EmbedderPolicy) *CorsObject
- func (cors *CorsObject) Frame(framesrc ...string) *CorsObject
- func (cors *CorsObject) Opener(o OpenerPolicy) *CorsObject
- func (cors *CorsObject) RenderCors(gtx *gin.Context)
- func (cors *CorsObject) Resource(r ResourcePolicy) *CorsObject
- func (cors *CorsObject) Script(scriptsrc ...string) *CorsObject
- type EmbedderPolicy
- type HashAlgorithm
- type HashDirFs
- func (hD *HashDirFs) GetNonce() (m map[string]string)
- func (hD *HashDirFs) GetSingleNonce(name string) string
- func (hD *HashDirFs) NewServeDirFs(r *gin.Engine, cors_ *CorsObject, cache_seconds time.Duration, reload bool) (err error)
- func (hD *HashDirFs) Route() string
- func (hD *HashDirFs) SetRoute(r string)
- type HashedFile
- type OpenerPolicy
- type ResourcePolicy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CorsObject ¶
type CorsObject struct { FrameSrc []string `json:"frame-src"` ChildSrc []string `json:"child-src"` ConnectSrc []string `json:"connect-src"` ScriptSrc []string `json:"script-src"` OriginEmbedder EmbedderPolicy `json:"embedder-policy"` OriginOpener OpenerPolicy `json:"opener-policy"` OriginResource ResourcePolicy `json:"resource-policy"` }
func NewCors ¶
func NewCors() *CorsObject
func (*CorsObject) Child ¶
func (cors *CorsObject) Child(childsrc ...string) *CorsObject
func (*CorsObject) Connect ¶
func (cors *CorsObject) Connect(connectsrc ...string) *CorsObject
func (*CorsObject) Embedder ¶
func (cors *CorsObject) Embedder(e EmbedderPolicy) *CorsObject
func (*CorsObject) Frame ¶
func (cors *CorsObject) Frame(framesrc ...string) *CorsObject
func (*CorsObject) Opener ¶
func (cors *CorsObject) Opener(o OpenerPolicy) *CorsObject
func (*CorsObject) RenderCors ¶
func (cors *CorsObject) RenderCors(gtx *gin.Context)
func (*CorsObject) Resource ¶
func (cors *CorsObject) Resource(r ResourcePolicy) *CorsObject
func (*CorsObject) Script ¶
func (cors *CorsObject) Script(scriptsrc ...string) *CorsObject
type EmbedderPolicy ¶
type EmbedderPolicy int
const ( EmbedderUnsafeNone EmbedderPolicy = iota + 1 EmbedderRequireCorp EmbedderCredentialLess )
func (EmbedderPolicy) Policy ¶
func (cep EmbedderPolicy) Policy() string
type HashAlgorithm ¶
type HashAlgorithm int
const ( HashAlgo256 HashAlgorithm = 256 HashAlgo384 HashAlgorithm = 384 HashAlgo512 HashAlgorithm = 512 )
type HashDirFs ¶
type HashDirFs struct {
// contains filtered or unexported fields
}
func NewHashDirFs ¶
func (*HashDirFs) GetSingleNonce ¶
func (*HashDirFs) NewServeDirFs ¶
type HashedFile ¶
type HashedFile struct {
// contains filtered or unexported fields
}
func NewHashedFile ¶
func NewHashedFile(path string, algo HashAlgorithm) (h *HashedFile, err error)
func (*HashedFile) Nonce ¶
func (h *HashedFile) Nonce() string
func (*HashedFile) Reload ¶
func (h *HashedFile) Reload() (*HashedFile, error)
func (*HashedFile) Replace ¶
func (h *HashedFile) Replace(mstr map[string]string) *HashedFile
func (*HashedFile) Str ¶
func (h *HashedFile) Str() string
type OpenerPolicy ¶
type OpenerPolicy int
const ( OpenerUnsafeNone OpenerPolicy = iota + 1 OpenerSameOriginAllowPopups OpenerSameOrigin )
func (OpenerPolicy) Policy ¶
func (cep OpenerPolicy) Policy() string
type ResourcePolicy ¶
type ResourcePolicy int
const ( ResourceSameSite ResourcePolicy = iota + 1 ResourceSameOrigin ResourceCrossOrigin )
func (ResourcePolicy) Policy ¶
func (rp ResourcePolicy) Policy() string
Click to show internal directories.
Click to hide internal directories.