controllers

package
v0.0.0-...-a062895 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Affiliations

func Affiliations(c *gin.Context)

GET /affiliations

func Contributors

func Contributors(c *gin.Context)

GET /contributors

func CreateResource

func CreateResource(c *gin.Context)

POST /resources Create new Resource

func FindAffiliations

func FindAffiliations(c *gin.Context)

func FindOrCreateLicense

func FindOrCreateLicense(rl *commonmeta.License) commonmeta.License

FindCreateLicense takes a pointer to a commonmeta.License struct and queries the DB License table for the first entry that matches the URL of the provided License struct. It creates the License in the DB in case no matching record was found and calls itself for another attempt. It returns the retreived commonmeta.License if the query was successful.

func FirstResource

func FirstResource(c *gin.Context)

GET /resource/:prefix/*suffix

func Publishers

func Publishers(c *gin.Context)

GET /publishers

func Resources

func Resources(c *gin.Context)

GET /resources

Types

type APIErrorResponse

type APIErrorResponse struct {
	Status  int    `json:"status,omitempty"`
	Success bool   `json:"success,omitempty"`
	Message string `json:"message,omitempty"`
	Error   string `json:"error,omitempty"`
	Level   string `json:"level,omitempty"` // Info, Warn, Error
}

Jump to

Keyboard shortcuts

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