views

package
v0.0.0-...-252d4e6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// WordsResultMap is a map indexing the attribute names of WordsResult by view
	// name.
	WordsResultMap = map[string][]string{
		"default": {
			"quote",
		},
	}
	// WordsTaskMap is a map indexing the attribute names of WordsTask by view name.
	WordsTaskMap = map[string][]string{
		"default": {
			"hash",
			"difficulty",
		},
	}
)

Functions

func ValidateWordsResult

func ValidateWordsResult(result *WordsResult) (err error)

ValidateWordsResult runs the validations defined on the viewed result type WordsResult.

func ValidateWordsResultView

func ValidateWordsResultView(result *WordsResultView) (err error)

ValidateWordsResultView runs the validations defined on WordsResultView using the "default" view.

func ValidateWordsTask

func ValidateWordsTask(result *WordsTask) (err error)

ValidateWordsTask runs the validations defined on the viewed result type WordsTask.

func ValidateWordsTaskView

func ValidateWordsTaskView(result *WordsTaskView) (err error)

ValidateWordsTaskView runs the validations defined on WordsTaskView using the "default" view.

Types

type WordsResult

type WordsResult struct {
	// Type to project
	Projected *WordsResultView
	// View to render
	View string
}

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

type WordsResultView

type WordsResultView struct {
	// Words of wisdome
	Quote *string
}

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

type WordsTask

type WordsTask struct {
	// Type to project
	Projected *WordsTaskView
	// View to render
	View string
}

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

type WordsTaskView

type WordsTaskView struct {
	// Previous hash
	Hash *string
	// Target difficulty
	Difficulty *int
}

WordsTaskView 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