util

package
v0.0.0-...-08ef0fc Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPageSize int = 20
	MaxPageSize     int = 500
)
View Source
const (
	CKUser = "user"
)

Variables

This section is empty.

Functions

func CreateRenderer

func CreateRenderer(templatePath string) multitemplate.Renderer

func GetPaginatedListFromRequest

func GetPaginatedListFromRequest(c *gin.Context, count int) *pkg.PaginatedList

func MockApiRouter

func MockApiRouter() *gin.Engine

func MockDB

func MockDB() *gorm.DB

func MockJWTAuth

func MockJWTAuth() gin.HandlerFunc

func MockWebRouter

func MockWebRouter() *gin.Engine

func RunApiTests

func RunApiTests(t *testing.T, r *gin.Engine, testCases []TestCase)

func RunWebTests

func RunWebTests(t *testing.T, r *gin.Engine, testCases []TestCase)

Types

type TestCase

type TestCase struct {
	Method           string
	Url              string
	Body             string
	ExpectedStatus   int
	ExpectedResponse string
}

type User

type User struct {
	ID string
	IP string
}

func Identity

func Identity(c context.Context) *User

Jump to

Keyboard shortcuts

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