views

package
v0.0.0-...-d8f6d10 Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NeatThingMap is a map of attribute names in result type NeatThing indexed by
	// view name.
	NeatThingMap = map[string][]string{
		"default": []string{
			"name",
			"definition",
			"link",
		},
		"full": []string{
			"name",
			"definition",
			"link",
			"date",
			"bibliography",
		},
		"name": []string{
			"name",
		},
		"name+definition": []string{
			"name",
			"definition",
		},
		"name+link": []string{
			"name",
			"link",
		},
	}
)

Functions

func ValidateNeatThing

func ValidateNeatThing(result *NeatThing) (err error)

ValidateNeatThing runs the validations defined on the viewed result type NeatThing.

func ValidateNeatThingView

func ValidateNeatThingView(result *NeatThingView) (err error)

ValidateNeatThingView runs the validations defined on NeatThingView using the "default" view.

func ValidateNeatThingViewFull

func ValidateNeatThingViewFull(result *NeatThingView) (err error)

ValidateNeatThingViewFull runs the validations defined on NeatThingView using the "full" view.

func ValidateNeatThingViewName

func ValidateNeatThingViewName(result *NeatThingView) (err error)

ValidateNeatThingViewName runs the validations defined on NeatThingView using the "name" view.

func ValidateNeatThingViewNameDefinition

func ValidateNeatThingViewNameDefinition(result *NeatThingView) (err error)

ValidateNeatThingViewNameDefinition runs the validations defined on NeatThingView using the "name+definition" view.

func ValidateNeatThingViewNameLink(result *NeatThingView) (err error)

ValidateNeatThingViewNameLink runs the validations defined on NeatThingView using the "name+link" view.

Types

type NeatThing

type NeatThing struct {
	// Type to project
	Projected *NeatThingView
	// View to render
	View string
}

NeatThing is the viewed result type that is projected based on a view.

type NeatThingView

type NeatThingView struct {
	// The neat thing
	Name *string
	// What the neat thing is
	Definition *string
	// Illustrative link for the neat thing
	Link *string
	// When this was a neat thing
	Date         *string
	Bibliography []string
}

NeatThingView is a type that runs validations on a projected type.

Jump to

Keyboard shortcuts

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