types

package
v1.6.18 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 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.

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 added in v1.3.0

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 added in v1.3.0

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

func (*Pagination) GetLimit added in v1.3.0

func (p *Pagination) GetLimit() int64

func (*Pagination) GetNext added in v1.3.0

func (p *Pagination) GetNext() string

func (*Pagination) GetOffset added in v1.3.0

func (p *Pagination) GetOffset() int64

func (*Pagination) GetOrder added in v1.3.0

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

func (*Pagination) GetPrev added in v1.3.0

func (p *Pagination) GetPrev() string

func (*Pagination) GetSearch added in v1.3.0

func (p *Pagination) GetSearch() string

func (*Pagination) GetSort added in v1.3.0

func (p *Pagination) GetSort() string

type PaginationConfig added in v1.3.1

type PaginationConfig struct {
	Pagination *Pagination
	WithLimit  bool
}

func NewPaginationConfig added in v1.3.1

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"`
	DepartmentID   string       `json:"departmentId"`
	OrganizationID string       `json:"organizationId"`
	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 added in v1.6.14

func (uc *UserClaims) IsCoordinatorRRHH() bool

IsCoordinatorRRHH checks if the user has the coordinator_rrhh role.

func (*UserClaims) IsDirectorRRHH added in v1.6.14

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