models

package
v0.0.0-...-947ddfb Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Route

type Route struct {
	// Key short URL name
	Key string `json:"Key"`

	// RedirectURL is the URL to redirect to
	RedirectURL string `json:"RedirectURL"`

	// ExtendedURL holds optional appended string to the RedirectURL
	ExtendedURL string `json:"ExtendedURL"`
}

func (*Route) Decode

func (r *Route) Decode(b *bytes.Buffer) error

func (*Route) Encode

func (r *Route) Encode() (*bytes.Buffer, error)

func (*Route) Validate

func (r *Route) Validate() error

Validate validates that a Route object is proper. The current validations are as follows:

  • Key is not empty
  • RedirectURL is not empty
  • If ExtendedURL is not empty, then RedirectURL must contain the format specifier "{}"

type User

type User struct {
	Username  string
	Email     string
	Password  string
	FirstName string
	LastName  string

	// TODO: perms fields
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt time.Time
}

Jump to

Keyboard shortcuts

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