models

package
v0.0.0-...-76f7c0c Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 4 Imported by: 17

Documentation

Index

Constants

View Source
const (
	UserSignUpEventName         = "userSignUp"
	NewKeyValuePairEventName    = "newKeyValuePair"
	DeleteKeyValuePairEventName = "deleteKeyValuePair"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteFileRequest

type DeleteFileRequest struct {
	Key string `json:"key"`
}

type DeleteFilesRequest

type DeleteFilesRequest struct {
	Prefix *string `json:"prefix,omitempty"`
}

type DeleteKeyValuePairEvent

type DeleteKeyValuePairEvent struct {
	Key string `json:"key"`
}

func (*DeleteKeyValuePairEvent) Name

func (e *DeleteKeyValuePairEvent) Name() string

type DeletePairRequest

type DeletePairRequest struct {
	Key string `form:"key" json:"key"`
}

type GetAllPairsRequest

type GetAllPairsRequest struct {
}

type GetFileRequest

type GetFileRequest struct {
	FileName string `json:"file_name" form:"file_name"`
}

type GetFilesResponse

type GetFilesResponse struct {
	Key          string     `json:"key" csv:"Key" excel:"Key"`
	LastModified *time.Time `json:"last_modified,omitempty" csv:"Last modified" excel:"Last modified"`
	Size         uint64     `json:"size" csv:"Size" excel:"Size"`
	StorageClass string     `json:"storage_class" csv:"Storage Class" excel:"Storage Class"`
}

type GetPairRequest

type GetPairRequest struct {
	Key string `form:"key" json:"key"`
}

type GetPairResponse

type GetPairResponse struct {
	Key   string `form:"key" json:"key"`
	Value string `form:"value" json:"value"`
}

type JSONError

type JSONError struct {
	StatusCode  int    `json:"status_code,omitempty"`
	Description string `json:"description,omitempty"`
	Field       string `json:"field,omitempty"`
}

func NewAlreadyReportedError

func NewAlreadyReportedError(description string, field ...string) *JSONError

func NewBadRequestError

func NewBadRequestError(description string, field ...string) *JSONError

func NewInternalServerError

func NewInternalServerError(description string, field ...string) *JSONError

func NewNotFoundError

func NewNotFoundError(description string, field ...string) *JSONError

func NewUnauthorizedError

func NewUnauthorizedError(description string, field ...string) *JSONError

func NewUnprocessableEntityError

func NewUnprocessableEntityError(description string, field ...string) *JSONError

type KeyValuePair

type KeyValuePair struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
}

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	QRCode   string `json:"qr_code"`
}

type LoginResponse

type LoginResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

type NewKeyValuePairEvent

type NewKeyValuePairEvent struct {
	Pairs []*KeyValuePair
}

func (*NewKeyValuePairEvent) Name

func (e *NewKeyValuePairEvent) Name() string

type PostPairRequest

type PostPairRequest struct {
	KeyValuePair
}

type SignUpRequest

type SignUpRequest struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

type TemplateData

type TemplateData struct {
	StringMap map[string]string
	IntMap    map[string]int
	FloatMap  map[string]float64
	Data      map[string]interface{}
	Flash     string
	Warning   string
	Error     string
}

type Token

type Token struct {
	AccessToken        string
	AccessTokenExpires int64
	AccessUUID         string
	// RefreshToken is used to create new pairs of access and refresh tokens,
	// typically when the access token has expired, so the user does not have to login in again.
	RefreshToken        string
	RefreshTokenExpires int64
	RefreshUUID         string
}

type User

type User struct {
	ID       int     `json:"-"`
	Name     string  `json:"name"`
	Email    string  `json:"email"`
	Password string  `json:"-"`
	QRSecret *string `json:"-"`
}

func (*User) CheckPassword

func (user *User) CheckPassword(password string) error

func (*User) HashPassword

func (user *User) HashPassword(password string) error

type UserSignUpEvent

type UserSignUpEvent struct {
	User    *User  `json:"user"`
	QrImage []byte `json:"qr_code,omitempty"`
}

func (*UserSignUpEvent) Name

func (e *UserSignUpEvent) Name() string

Name returns the event's name

Jump to

Keyboard shortcuts

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