views

package
v2.1.1+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ChatSummaryCollectionMap is a map of attribute names in result type
	// ChatSummaryCollection indexed by view name.
	ChatSummaryCollectionMap = map[string][]string{
		"tiny": []string{
			"message",
		},
		"default": []string{
			"message",
			"length",
			"sent_at",
		},
	}
	// ChatSummaryMap is a map of attribute names in result type ChatSummary
	// indexed by view name.
	ChatSummaryMap = map[string][]string{
		"tiny": []string{
			"message",
		},
		"default": []string{
			"message",
			"length",
			"sent_at",
		},
	}
)

Functions

func ValidateChatSummary

func ValidateChatSummary(result *ChatSummary) (err error)

ValidateChatSummary runs the validations defined on the viewed result type ChatSummary.

func ValidateChatSummaryCollection

func ValidateChatSummaryCollection(result ChatSummaryCollection) (err error)

ValidateChatSummaryCollection runs the validations defined on the viewed result type ChatSummaryCollection.

func ValidateChatSummaryCollectionView

func ValidateChatSummaryCollectionView(result ChatSummaryCollectionView) (err error)

ValidateChatSummaryCollectionView runs the validations defined on ChatSummaryCollectionView using the "default" view.

func ValidateChatSummaryCollectionViewTiny

func ValidateChatSummaryCollectionViewTiny(result ChatSummaryCollectionView) (err error)

ValidateChatSummaryCollectionViewTiny runs the validations defined on ChatSummaryCollectionView using the "tiny" view.

func ValidateChatSummaryView

func ValidateChatSummaryView(result *ChatSummaryView) (err error)

ValidateChatSummaryView runs the validations defined on ChatSummaryView using the "default" view.

func ValidateChatSummaryViewTiny

func ValidateChatSummaryViewTiny(result *ChatSummaryView) (err error)

ValidateChatSummaryViewTiny runs the validations defined on ChatSummaryView using the "tiny" view.

Types

type ChatSummary

type ChatSummary struct {
	// Type to project
	Projected *ChatSummaryView
	// View to render
	View string
}

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

type ChatSummaryCollection

type ChatSummaryCollection struct {
	// Type to project
	Projected ChatSummaryCollectionView
	// View to render
	View string
}

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

type ChatSummaryCollectionView

type ChatSummaryCollectionView []*ChatSummaryView

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

type ChatSummaryView

type ChatSummaryView struct {
	// Message sent to the server
	Message *string
	// Length of the message sent
	Length *int
	// Time at which the message was sent
	SentAt *string
}

ChatSummaryView 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