cookieservice

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ProviderSet provides a CookieService.
	ProviderSet = wire.NewSet(Provide, wire.Bind(new(domain.CookieService), new(*CookieService)), Cfg)
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Domain        string
	SecureCookies bool
	SameSite      http.SameSite
}

Config represents configuration for a CookieService.

func Cfg

func Cfg(v *viper.Viper) *Config

Cfg returns a Config configured with elements from a Viper.

type CookieService

type CookieService struct {
	Cfg Config
}

CookieService manages operations on cookies.

func NewCookieService

func NewCookieService(cfg Config) *CookieService

NewCookieService returns a CookieService configured with the provided Config.

func Provide

func Provide(cfg *Config) *CookieService

Provide returns a CookieService configured with the provided Config.

func (*CookieService) SetCookie

func (c *CookieService) SetCookie(g *gin.Context, name string, value string, maxAge int, path string, httpOnly bool)

SetCookie a cookie containing the provided values.

Jump to

Keyboard shortcuts

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