types

package
v1.7.14 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ContentLanguageKey contextKey = "contentLanguage"

ContentLanguageKey is a context key used to store the content language. It is used to retrieve the content language from the context.

View Source
const CountryCodeKey contextKey = "countryCode"

CountryCodeKey is a context key used to store the country code. It is used to retrieve the country code from the context.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Status  int      `json:"status"`  // The HTTP status code of the error response.
	Message string   `json:"message"` // The error message.
	Errors  []string `json:"errors"`  // A list of specific error messages.
}

ErrorResponse represents an error response returned by the API. @name ErrorResponse @field:status "The HTTP status code of the error response." @field:message "The error message." @field:errors "A list of specific error messages."

type Filter

type Filter struct {
	Field    string
	Operator enums.Operator
	Value    interface{}
}

type Pagination

type Pagination struct {
	Offset  int64
	Limit   int64
	Search  string
	Sort    string
	Order   enums.SortOrder
	Next    string
	Prev    string
	Filters []Filter
}

func (*Pagination) GetFilters

func (p *Pagination) GetFilters() []Filter

func (*Pagination) GetLimit

func (p *Pagination) GetLimit() int64

func (*Pagination) GetNext

func (p *Pagination) GetNext() string

func (*Pagination) GetOffset

func (p *Pagination) GetOffset() int64

func (*Pagination) GetOrder

func (p *Pagination) GetOrder() enums.SortOrder

func (*Pagination) GetPrev

func (p *Pagination) GetPrev() string

func (*Pagination) GetSearch

func (p *Pagination) GetSearch() string

func (*Pagination) GetSort

func (p *Pagination) GetSort() string

type PaginationConfig

type PaginationConfig struct {
	Pagination      *Pagination
	WithLimit       bool
	WithAtlasSearch bool
}

func NewPaginationConfig

func NewPaginationConfig(pagination *Pagination) *PaginationConfig

type UserClaims

type UserClaims struct {
	ID             string       `json:"id"`
	Name           string       `json:"name"`
	LastName       string       `json:"lastName"`
	ProfilePicture string       `json:"profilePicture"`
	Group          string       `json:"group"`
	OrganizationID string       `json:"organization"`
	Email          string       `json:"email"`
	Roles          []enums.Role `json:"roles"`
	IsConfirmed    bool         `json:"isConfirmed"`
	IsBlocked      bool         `json:"isBlocked"`
	jwt.StandardClaims
}

UserClaims represents the claims of a user in the system.

func (*UserClaims) IsAdmin

func (uc *UserClaims) IsAdmin() bool

IsAdmin checks if the user has the admin role.

func (*UserClaims) IsAuthor

func (uc *UserClaims) IsAuthor() bool

IsAuthor checks if the user has the author role.

func (*UserClaims) IsCoordinatorRRHH

func (uc *UserClaims) IsCoordinatorRRHH() bool

IsCoordinatorRRHH checks if the user has the coordinator_rrhh role.

func (*UserClaims) IsDirectorRRHH

func (uc *UserClaims) IsDirectorRRHH() bool

IsDirectorRRHH checks if the user has the director_rrhh role.

func (*UserClaims) IsEditor

func (uc *UserClaims) IsEditor() bool

IsEditor checks if the user has the editor role.

func (*UserClaims) IsUser

func (uc *UserClaims) IsUser() bool

IsUser checks if the user has the user role.

Jump to

Keyboard shortcuts

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