Documentation ¶
Index ¶
- Variables
- func ValidateAuthorPhotoView(result *AuthorPhotoView) (err error)
- func ValidateDiscussion(result *Discussion) (err error)
- func ValidateDiscussionView(result *DiscussionView) (err error)
- func ValidatePostAuthorView(result *PostAuthorView) (err error)
- func ValidateThreadedPostView(result *ThreadedPostView) (err error)
- type AuthorPhotoView
- type Discussion
- type DiscussionView
- type PostAuthorView
- type ThreadedPostView
Constants ¶
This section is empty.
Variables ¶
var ( // DiscussionMap is a map of attribute names in result type Discussion indexed // by view name. DiscussionMap = map[string][]string{ "default": []string{ "posts", }, } // ThreadedPostMap is a map of attribute names in result type ThreadedPost // indexed by view name. ThreadedPostMap = map[string][]string{ "default": []string{ "id", "createdAt", "updatedAt", "author", "replies", "body", "bookmark", }, } )
Functions ¶
func ValidateAuthorPhotoView ¶
func ValidateAuthorPhotoView(result *AuthorPhotoView) (err error)
ValidateAuthorPhotoView runs the validations defined on AuthorPhotoView.
func ValidateDiscussion ¶
func ValidateDiscussion(result *Discussion) (err error)
ValidateDiscussion runs the validations defined on the viewed result type Discussion.
func ValidateDiscussionView ¶
func ValidateDiscussionView(result *DiscussionView) (err error)
ValidateDiscussionView runs the validations defined on DiscussionView using the "default" view.
func ValidatePostAuthorView ¶
func ValidatePostAuthorView(result *PostAuthorView) (err error)
ValidatePostAuthorView runs the validations defined on PostAuthorView.
func ValidateThreadedPostView ¶
func ValidateThreadedPostView(result *ThreadedPostView) (err error)
ValidateThreadedPostView runs the validations defined on ThreadedPostView using the "default" view.
Types ¶
type AuthorPhotoView ¶
type AuthorPhotoView struct {
URL *string
}
AuthorPhotoView is a type that runs validations on a projected type.
type Discussion ¶
type Discussion struct { // Type to project Projected *DiscussionView // View to render View string }
Discussion is the viewed result type that is projected based on a view.
type DiscussionView ¶
type DiscussionView struct {
Posts []*ThreadedPostView
}
DiscussionView 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.
type ThreadedPostView ¶
type ThreadedPostView struct { ID *int64 CreatedAt *int64 UpdatedAt *int64 Author *PostAuthorView Replies []*ThreadedPostView Body *string Bookmark *string }
ThreadedPostView is a type that runs validations on a projected type.