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 (
	// FollowersPageMap is a map of attribute names in result type FollowersPage
	// indexed by view name.
	FollowersPageMap = map[string][]string{
		"default": []string{
			"followers",
			"total",
			"page",
		},
	}
	// FollowerCollectionMap is a map of attribute names in result type
	// FollowerCollection indexed by view name.
	FollowerCollectionMap = map[string][]string{
		"default": []string{
			"id",
			"name",
			"avatar",
		},
	}
	// FollowerMap is a map of attribute names in result type Follower indexed by
	// view name.
	FollowerMap = map[string][]string{
		"default": []string{
			"id",
			"name",
			"avatar",
		},
	}
)

Functions

func ValidateAvatarView

func ValidateAvatarView(result *AvatarView) (err error)

ValidateAvatarView runs the validations defined on AvatarView.

func ValidateFollowerCollectionView

func ValidateFollowerCollectionView(result FollowerCollectionView) (err error)

ValidateFollowerCollectionView runs the validations defined on FollowerCollectionView using the "default" view.

func ValidateFollowerView

func ValidateFollowerView(result *FollowerView) (err error)

ValidateFollowerView runs the validations defined on FollowerView using the "default" view.

func ValidateFollowersPage

func ValidateFollowersPage(result *FollowersPage) (err error)

ValidateFollowersPage runs the validations defined on the viewed result type FollowersPage.

func ValidateFollowersPageView

func ValidateFollowersPageView(result *FollowersPageView) (err error)

ValidateFollowersPageView runs the validations defined on FollowersPageView using the "default" view.

Types

type AvatarView

type AvatarView struct {
	URL *string
}

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

type FollowerCollectionView

type FollowerCollectionView []*FollowerView

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

type FollowerView

type FollowerView struct {
	ID     *int64
	Name   *string
	Avatar *AvatarView
}

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

type FollowersPage

type FollowersPage struct {
	// Type to project
	Projected *FollowersPageView
	// View to render
	View string
}

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

type FollowersPageView

type FollowersPageView struct {
	Followers FollowerCollectionView
	Total     *int32
	Page      *int32
}

FollowersPageView 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