views

package
v0.0.0-...-b9360c4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DataEventsMap is a map of attribute names in result type DataEvents indexed
	// by view name.
	DataEventsMap = map[string][]string{
		"default": []string{
			"events",
		},
	}
	// DataEventMap is a map of attribute names in result type DataEvent indexed by
	// view name.
	DataEventMap = map[string][]string{
		"default": []string{
			"id",
			"createdAt",
			"updatedAt",
			"author",
			"title",
			"description",
			"bookmark",
			"start",
			"end",
		},
	}
)

Functions

func ValidateAuthorPhotoView

func ValidateAuthorPhotoView(result *AuthorPhotoView) (err error)

ValidateAuthorPhotoView runs the validations defined on AuthorPhotoView.

func ValidateDataEventView

func ValidateDataEventView(result *DataEventView) (err error)

ValidateDataEventView runs the validations defined on DataEventView using the "default" view.

func ValidateDataEvents

func ValidateDataEvents(result *DataEvents) (err error)

ValidateDataEvents runs the validations defined on the viewed result type DataEvents.

func ValidateDataEventsView

func ValidateDataEventsView(result *DataEventsView) (err error)

ValidateDataEventsView runs the validations defined on DataEventsView using the "default" view.

func ValidatePostAuthorView

func ValidatePostAuthorView(result *PostAuthorView) (err error)

ValidatePostAuthorView runs the validations defined on PostAuthorView.

Types

type AuthorPhotoView

type AuthorPhotoView struct {
	URL *string
}

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

type DataEventView

type DataEventView struct {
	ID          *int64
	CreatedAt   *int64
	UpdatedAt   *int64
	Author      *PostAuthorView
	Title       *string
	Description *string
	Bookmark    *string
	Start       *int64
	End         *int64
}

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

type DataEvents

type DataEvents struct {
	// Type to project
	Projected *DataEventsView
	// View to render
	View string
}

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

type DataEventsView

type DataEventsView struct {
	Events []*DataEventView
}

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

type PostAuthorView

type PostAuthorView struct {
	ID    *int32
	Name  *string
	Photo *AuthorPhotoView
}

PostAuthorView 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