api

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const SablierStatusHeader = "X-Sablier-Session-Status"
View Source
const SablierStatusNotReady = "not-ready"
View Source
const SablierStatusReady = "ready"

Variables

This section is empty.

Functions

func AbortWithProblemDetail

func AbortWithProblemDetail(c *gin.Context, p rfc7807.Problem)

func AddSablierHeader

func AddSablierHeader(c *gin.Context, session *sablier.SessionState)

func Healthcheck

func Healthcheck(router *gin.RouterGroup, ctx context.Context)

func ListThemes

func ListThemes(router *gin.RouterGroup, s *ServeStrategy)

func ProblemError

func ProblemError(e error) rfc7807.Problem

func ProblemGroupNotFound

func ProblemGroupNotFound(e sablier.ErrGroupNotFound) rfc7807.Problem

func ProblemThemeNotFound

func ProblemThemeNotFound(e theme.ErrThemeNotFound) rfc7807.Problem

func ProblemValidation

func ProblemValidation(e error) rfc7807.Problem

func StartBlocking

func StartBlocking(router *gin.RouterGroup, s *ServeStrategy)

func StartDynamic

func StartDynamic(router *gin.RouterGroup, s *ServeStrategy)

Types

type BlockingRequest added in v1.9.0

type BlockingRequest struct {
	Names           []string      `form:"names"`
	Group           string        `form:"group"`
	SessionDuration time.Duration `form:"session_duration"`
	Timeout         time.Duration `form:"timeout"`
}

type DynamicRequest added in v1.9.0

type DynamicRequest struct {
	Group            string        `form:"group"`
	Names            []string      `form:"names"`
	ShowDetails      bool          `form:"show_details"`
	DisplayName      string        `form:"display_name"`
	Theme            string        `form:"theme"`
	SessionDuration  time.Duration `form:"session_duration"`
	RefreshFrequency time.Duration `form:"refresh_frequency"`
}

type Health

type Health struct {
	TerminatingStatusCode int `` /* 129-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Health) ServeHTTP

func (h *Health) ServeHTTP(c *gin.Context)

func (*Health) SetDefaults

func (h *Health) SetDefaults()

func (*Health) WithContext

func (h *Health) WithContext(ctx context.Context)

type Sablier added in v1.9.0

type Sablier interface {
	RequestSession(ctx context.Context, names []string, duration time.Duration) (*sablier.SessionState, error)
	RequestSessionGroup(ctx context.Context, group string, duration time.Duration) (*sablier.SessionState, error)
	RequestReadySession(ctx context.Context, names []string, duration time.Duration, timeout time.Duration) (*sablier.SessionState, error)
	RequestReadySessionGroup(ctx context.Context, group string, duration time.Duration, timeout time.Duration) (*sablier.SessionState, error)
}

type ServeStrategy added in v1.9.0

type ServeStrategy struct {
	Theme *theme.Themes

	Sablier        Sablier
	StrategyConfig config.Strategy
	SessionsConfig config.Sessions
}

Directories

Path Synopsis
Package apitest is a generated GoMock package.
Package apitest is a generated GoMock package.

Jump to

Keyboard shortcuts

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