forms

package
v0.0.0-...-00868d9 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorArray2Error

func ErrorArray2Error(errs []error) (err error)

Types

type PlaylistForm

type PlaylistForm struct {
	Name        string `json:"name" validate:"required,min=1,max=256"`
	Description string `json:"description"`
	Private     bool   `json:"is_private"`
}

type RadioValidationErrors

type RadioValidationErrors struct {
	Errors map[string][]string `json:"errors"`
}

func Error2RadioValidationErrors

func Error2RadioValidationErrors(err error) *RadioValidationErrors

func ErrorArray2RadioValidationErrors

func ErrorArray2RadioValidationErrors(errs []error) *RadioValidationErrors

func ValidateForm

func ValidateForm(form interface{}) *RadioValidationErrors

type SignInForm

type SignInForm struct {
	Username string `json:"username" validate:"required,alphanum,min=1"`
	Password string `json:"password" validate:"required,min=1"`
}

type SignUpForm

type SignUpForm struct {
	Username         string `json:"username" validate:"required,alphanum,min=2,max=32"`
	Password         string `json:"password" validate:"required,min=6,max=64"`
	RepeatedPassword string `json:"repeated_password" validate:"required,eqfield=Password"`
}

type TrackCreateForm

type TrackCreateForm struct {
	PlaylistID uint `json:"playlist_id" validate:"required,numeric"`
}

type TrackForm

type TrackForm struct {
	Name string `json:"name" validate:"required,alphanumunicode,min=1,max=256"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL