views

package
v0.0.0-...-d31d36d Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HelloMap is a map indexing the attribute names of Hello by view name.
	HelloMap = map[string][]string{
		"default": {
			"greeting",
			"outcome",
		},
	}
)

Functions

func ValidateHello

func ValidateHello(result *Hello) (err error)

ValidateHello runs the validations defined on the viewed result type Hello.

func ValidateHelloView

func ValidateHelloView(result *HelloView) (err error)

ValidateHelloView runs the validations defined on HelloView using the "default" view.

Types

type Hello

type Hello struct {
	// Type to project
	Projected *HelloView
	// View to render
	View string
}

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

type HelloView

type HelloView struct {
	// The greeting message
	Greeting *string
	Outcome  *string `json:"-"`
}

HelloView 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