models

package
v0.0.0-...-6162916 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 13 Imported by: 4

Documentation

Index

Constants

View Source
const MaxQueSize = 999999 // max number of items in any of the queues

Variables

View Source
var (
	ErrType_userMissing   = errors.New("User missing from context")
	ErrType_noIdentifiers = errors.New("Bearer token is missing identifiers")

	ErrType_invalidUUID = errors.New("Invalid UUID")
	ErrType_permission  = errors.New("You don't have permission to do this")

	ErrType_tookLongTime = errors.New("request took a long time to complete")

	ErrType_nonFatal     = errors.New("non fatal error occured")
	ErrType_returnToUser = errors.New("Error Occured")
)
View Source
var MaxMask int64 = 2<<53 - 1 // max int we can hold in javascript

Functions

This section is empty.

Types

type ApiString

type ApiString string

-----

func (*ApiString) Email

func (this *ApiString) Email() bool

func (*ApiString) Equal

func (this *ApiString) Equal(in string) bool

! \brief Does a case insensitive string compare

func (*ApiString) Hash

func (this *ApiString) Hash() string

func (*ApiString) Html

func (this *ApiString) Html() template.HTML

func (*ApiString) Int

func (this *ApiString) Int() int64

func (*ApiString) JsonString

func (this *ApiString) JsonString() string

func (*ApiString) Nullable

func (this *ApiString) Nullable() (out sql.NullString)

func (*ApiString) PassRequires

func (this *ApiString) PassRequires() string

func (*ApiString) Password

func (this *ApiString) Password() bool

func (*ApiString) Phone

func (this *ApiString) Phone() bool

func (*ApiString) SafeRegex

func (this *ApiString) SafeRegex() string

! \brief Preps a string for use in the database by removing "weird" characters

func (*ApiString) Set

func (this *ApiString) Set(str string)

func (*ApiString) Sprintf

func (this *ApiString) Sprintf(msg string, params ...interface{})

! \brief Sets the value of our object using an sprintf

func (*ApiString) String

func (this *ApiString) String() string

func (*ApiString) Url

func (this *ApiString) Url() bool

! \brief Validates the string as a url and sets it if it is

func (*ApiString) Valid

func (this *ApiString) Valid() bool

type EnumString

type EnumString string

func (EnumString) Int

func (this EnumString) Int() int64

func (*EnumString) Set

func (this *EnumString) Set(in string)

func (EnumString) String

func (this EnumString) String() string

type ProductionLevel

type ProductionLevel int
const (
	ProductionLevel_Dev ProductionLevel = iota
	ProductionLevel_Production
	ProductionLevel_Staging
)

type QueTask

type QueTask int

----- TASKS -----//

const (
	QueTask_nothing QueTask = iota
)

type Que_t

type Que_t struct {
	Type    QueTask
	Expires int64
	UserID  UUID `json:",omitempty"`
}

type ScheduleType

type ScheduleType int64

----- SCHEDULES -----// these are from the schedules table in the database

const (
	ScheduleType_none ScheduleType = iota
)

type Schedule_t

type Schedule_t struct {
	ID       UUID `json:",omitempty"`
	Type     ScheduleType
	Interval ApiString
	Attr     struct {
		Desc, Email string `json:",omitempty"`
	}
}

type UUID

type UUID string

func (UUID) Int

func (this UUID) Int() int64

func (*UUID) Key

func (this *UUID) Key(in string) string

func (*UUID) Nullable

func (this *UUID) Nullable() (out sql.NullString)

func (*UUID) Query

func (this *UUID) Query(r *http.Request) bool

! \brief This will try to set the id from the query param id

func (*UUID) Set

func (this *UUID) Set(in string)

func (UUID) String

func (this UUID) String() string

func (UUID) Valid

func (this UUID) Valid() bool

type UserMask

type UserMask int64
const (
	UserMask_deleted UserMask = 1 << iota //
)

type User_t

type User_t struct {
	ID                     UUID
	Email, Password, Token ApiString
	Mask                   UserMask `json:",omitempty"`
	Created                time.Time
	Attr                   struct {
		First, Last ApiString `json:",omitempty"`
	}
}

func (*User_t) SetToken

func (this *User_t) SetToken()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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