helper

package
v0.0.0-...-3ed7ff5 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleAdmin = "admin"
	RoleUser  = "user"
)

Variables

This section is empty.

Functions

func FormatDate

func FormatDate(date time.Time) string

func IntOrZero

func IntOrZero(i *int) int

func StringOrEmpty

func StringOrEmpty(s *string) string

func UintOrZero

func UintOrZero(u *uint) uint

Types

type ContextHelper

type ContextHelper struct{}

func NewContextHelper

func NewContextHelper() *ContextHelper

func (*ContextHelper) GetJWTClaims

func (h *ContextHelper) GetJWTClaims(ctx context.Context) (*jwt.JWTClaims, error)

func (*ContextHelper) IsAdmin

func (h *ContextHelper) IsAdmin(ctx context.Context) bool

func (*ContextHelper) VerifyOwnership

func (h *ContextHelper) VerifyOwnership(ctx context.Context, resourceOwnerID string) error

type SQLTime

type SQLTime time.Time

SQLTime is a custom type to handle PostgreSQL's time type

func (SQLTime) MarshalJSON

func (st SQLTime) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*SQLTime) Scan

func (st *SQLTime) Scan(value interface{}) error

Scan implements the sql.Scanner interface

func (SQLTime) String

func (st SQLTime) String() string

String returns the time in HH:MM:SS format

func (*SQLTime) UnmarshalJSON

func (st *SQLTime) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

func (SQLTime) Value

func (st SQLTime) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type TicketType

type TicketType struct {
	Short string
	Long  string
}

func TicketUpper

func TicketUpper(s string) TicketType

Jump to

Keyboard shortcuts

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