helpers

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Controller

func Controller(c *gin.Context) api.Controller

Get the controller and user (as created by the decorators)

func GetProject

func GetProject(c *gin.Context) kodex.Project

func JSON

func JSON(request *http.Request, checkContentType bool) (interface{}, error)

func JSONData

func JSONData(c *gin.Context) map[string]interface{}

Return the JSON data submitted in the request body

func Meter

func Meter(meter kodex.ModelMeter, c *gin.Context, model kodex.Model, name string, data map[string]string, count int64) error

func Organization

func Organization(c *gin.Context) api.Organization

func PlainTextJSONData

func PlainTextJSONData(c *gin.Context) map[string]interface{}

func QueryToConfig

func QueryToConfig(query url.Values) map[string]interface{}

func SanitizeReferer

func SanitizeReferer(referer string) string

Removes the query (which is potentially personally identifiable information) from the URL

func User

func User(c *gin.Context) *api.ExternalUser

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func MakeURLCache

func MakeURLCache() *Cache

func (*Cache) Get

func (c *Cache) Get(url string) (*Content, error)

type Content

type Content struct {
	Type      string
	FetchedAt time.Time
	Data      []byte
}

type ContentType

type ContentType struct {
	MediaType string
	Charset   string
	Boundary  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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