models

package
v0.0.0-...-b1c7972 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	Status  int         `json:"status"`
	IsError bool        `json:"isError"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type Signal

type Signal struct{}

type SpendKind

type SpendKind struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

func (*SpendKind) String

func (sk *SpendKind) String() string

type SpendKindDTO

type SpendKindDTO struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

func NewSpendKindDTO

func NewSpendKindDTO(spendKind *SpendKind) SpendKindDTO

type Spending

type Spending struct {
	ID        string     `json:"id"`
	Currency  string     `json:"currency"`
	Amount    float32    `json:"amount"`
	Kind      *SpendKind `json:"kind"`
	Timestamp time.Time  `json:"timestamp"`
}

func (*Spending) String

func (s *Spending) String() string

type SpendingDTO

type SpendingDTO struct {
	ID        string       `json:"id"`
	Currency  string       `json:"currency"`
	Amount    float32      `json:"amount"`
	Kind      SpendKindDTO `json:"kind"`
	Timestamp time.Time    `json:"timestamp"`
}

func NewSpendingDTO

func NewSpendingDTO(spending *Spending) SpendingDTO

type User

type User struct {
	Email      string      `json:"email"`
	Username   string      `json:"username"`
	Password   string      `json:"password"`
	Spends     []Spending  `json:"spends"`
	SpendKinds []SpendKind `json:"spending_kinds"`
}

func NewUser

func NewUser(email string, username string, password string, spendKinds []SpendKind) *User

type UserDTO

type UserDTO struct {
	Email      string         `json:"email"`
	Username   string         `json:"username"`
	Spends     []SpendingDTO  `json:"spends"`
	SpendKinds []SpendKindDTO `json:"spending_kinds"`
}

func NewUserDTO

func NewUserDTO(user *User) UserDTO

type Users

type Users []*User

Jump to

Keyboard shortcuts

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