maintenance

package
v0.0.0-...-7ff62be Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDisabled = errors.New("maintenance mode has already been disabled")
View Source
var ErrEnabled = errors.New("maintenance mode has already been enabled")

Functions

This section is empty.

Types

type API

type API interface {
	Maintenance(c *gin.Context)
}

func NewApi

func NewApi(store Store) API

type Request

type Request struct {
	Message string `json:"message"`
	Color   string `json:"color" binding:"iscolororempty"`
	Enabled *bool  `json:"enabled" binding:"required"`
}

type Store

type Store interface {
	Enable(ctx context.Context, message, color, userID string) error
	Disable(ctx context.Context, userID string) error
}

func NewStore

func NewStore(
	dbClient mongo.DbClient,
	userProvider security.UserProvider,
	tokenService apisecurity.TokenService,
	sessionStore session.Store,
) Store

Jump to

Keyboard shortcuts

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