models

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CategoryContent = "Content"
View Source
var LocationKey = "location"

Functions

func ClearAsset

func ClearAsset(content ContentMap, keyString string) error

func GetField

func GetField(content ContentMap, keyString string, defaultValue string) string

func PrettyPrint

func PrettyPrint(v interface{})

PrettyPrint logs maps and structs in formatted way in the console.

func SetField

func SetField(content ContentMap, keyString string, field string)

Types

type Category

type Category struct {
	ID          int    `json:"id" validate:"required"`
	Name        string `json:"name" validate:"required"`
	Description string `json:"description" validate:"required"`
}

type ContentMap

type ContentMap map[string]string

type Resource

type Resource struct {
	ID       uuid.UUID  `json:"id" validate:"required"`
	Category int        `json:"category" validate:"required"`
	Content  ContentMap `json:"content" validate:"required"`
}

func NewResource

func NewResource(idString string, category int, location string) (*Resource, error)

Jump to

Keyboard shortcuts

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