v1beta1

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package v1beta1 is the v1beta version of the api

Index

Constants

View Source
const (
	// UserStatusActive is the status for an active user
	UserStatusActive = "active"

	// UserStatusPending is the status for a pending user
	UserStatusPending = "pending"

	// UserStatusSuspended is the status for a suspended user
	UserStatusSuspended = "suspended"
)
View Source
const (
	// Version is the API version constant
	Version = "v1beta1"
)

Variables

View Source
var ErrInvalidFunctionParameter = errors.New("InvalidFunctionParameter")

ErrInvalidFunctionParameter is returned when a function parameter fails an assertion

View Source
var ErrInvalidQueryParameterValue = errors.New("InvalidQueryParameterValue")

ErrInvalidQueryParameterValue is returned when the query parameter value is invalid

Functions

This section is empty.

Types

type PaginationParams

type PaginationParams struct {
	Limit      int    `json:"limit,omitempty"`
	Last       bool   `json:"last,omitempty"`
	NextCursor string `json:"next_cursor,omitempty"`
	PrevCursor string `json:"prev_cursor,omitempty"`
	SortBy     string `json:"sort_by,omitempty"`
	SortOrder  string `json:"sort_order,omitempty"`
	OrderBy    string `json:"orderby,omitempty"`
}

PaginationParams is the params to be parsed from query params from a gin context

type PaginationResponse

type PaginationResponse[modelType any] struct {
	TotalRecordCount int64       `json:"total_record_count,omitempty"`
	NextCursor       string      `json:"next_cursor,omitempty"`
	PrevCursor       string      `json:"prev_cursor,omitempty"`
	Records          []modelType `json:"records"`
}

PaginationResponse is the response given to GET requests requiring pagination

type Router

type Router struct {
	AdminGroups    []string
	AuditLogWriter io.Writer
	AuditMW        *ginaudit.Middleware
	AuthMW         *ginauth.MultiTokenMiddleware
	AuthConf       []ginjwt.AuthConfig
	DB             *sqlx.DB
	EventBus       *eventbus.Client
	Logger         *zap.Logger
}

Router is the API router

func (*Router) Routes

func (r *Router) Routes(rg *gin.RouterGroup)

Routes sets up protected routes and sets the scopes for said routes

type User

type User struct {
	*models.User
	Memberships        []string `json:"memberships,omitempty"`
	MembershipsDirect  []string `json:"memberships_direct,omitempty"`
	MembershipRequests []string `json:"membership_requests,omitempty"`
}

User is a user response

Jump to

Keyboard shortcuts

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