models

package
v0.0.0-...-3385ac3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserStatusNotActive = iota
	UserStatusActive
	UserStatusBanned
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

type Monitor struct {
	Id        int
	UserId    int64
	Url       string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func FromDBMonitor

func FromDBMonitor(dbMonitor repository.Monitor) *Monitor

func (*Monitor) UpdateUrl

func (m *Monitor) UpdateUrl(newUrl string) error

func (*Monitor) Validate

func (m *Monitor) Validate() error

type User

type User struct {
	Id         int64
	ProviderId string
	Provider   string
	Email      string
	Name       string
	Status     UserStatus
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

func FromDBUser

func FromDBUser(dbUser repository.User) *User

func (*User) Activate

func (u *User) Activate()

func (*User) IsActive

func (u *User) IsActive() bool

func (*User) Validate

func (u *User) Validate() error

type UserStatus

type UserStatus int

func UserStatusFromString

func UserStatusFromString(status string) (UserStatus, error)

func (UserStatus) String

func (us UserStatus) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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