views

package
v0.0.0-...-69a499a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// UserMediaMap is a map of attribute names in result type UserMedia indexed by
	// view name.
	UserMediaMap = map[string][]string{
		"default": []string{
			"id",
			"phone",
			"lastName",
			"updatedAt",
			"email",
			"createdAt",
			"firstName",
			"countryPhoneCode",
			"changingEmail",
			"isAdmin",
			"verifiedEmail",
			"Authorization",
			"X-Session",
		},
	}
)

Functions

func ValidateUserMedia

func ValidateUserMedia(result *UserMedia) (err error)

ValidateUserMedia runs the validations defined on the viewed result type UserMedia.

func ValidateUserMediaView

func ValidateUserMediaView(result *UserMediaView) (err error)

ValidateUserMediaView runs the validations defined on UserMediaView using the "default" view.

Types

type UserMedia

type UserMedia struct {
	// Type to project
	Projected *UserMediaView
	// View to render
	View string
}

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

type UserMediaView

type UserMediaView struct {
	// Unique unchanging user ID
	ID *string
	// Given name for the user
	FirstName *string
	// Family name for the user
	LastName *string
	// Email attached to the account of the user
	Email *string
	// Phone Number Of the user
	Phone *string
	// When the user attempts to change their email, this is what they will change
	// it to after they verify that it belongs to them
	ChangingEmail *string
	// Whether the user has verified their email
	VerifiedEmail *bool
	// Whether the user is an administrator on the site
	IsAdmin          *bool
	UpdatedAt        *string
	IsActive         *bool
	CreatedAt        *string
	CountryPhoneCode *string
	Authorization    *string
	XSession         *string
}

UserMediaView 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