models

package
v0.0.0-...-d9bd7fb Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountCreatedDTO

type AccountCreatedDTO struct {
	ID               string    `db:"id" json:"id"`
	Username         string    `json:"username"`
	Email            string    `db:"email" json:"email"`
	RegistrationDate time.Time `db:"registration_date" json:"registration_date"`
}

type ErrorCode

type ErrorCode int32
const (
	Unknown ErrorCode = iota
	Internal
	InvalidArgument
	Unauthenticated
	Conflict
	NotFound
	Canceled
	DeadlineExceeded
	PermissionDenied
)

func Code

func Code(err error) ErrorCode

func (ErrorCode) String

func (t ErrorCode) String() string

type Profile

type Profile struct {
	AccountID         string
	Username          string
	Email             string
	ProfilePictureURL string
	RegistrationDate  time.Time
}

type RepositoryProfile

type RepositoryProfile struct {
	AccountID        string    `db:"account_id"`
	Username         string    `db:"username"`
	Email            string    `db:"email"`
	ProfilePictureID string    `db:"profile_picture_id"`
	RegistrationDate time.Time `db:"registration_date"`
}

type ServiceError

type ServiceError struct {
	Msg  string
	Code ErrorCode
}

func Error

func Error(code ErrorCode, msg string) *ServiceError

func Errorf

func Errorf(code ErrorCode, format string, a ...any) *ServiceError

func (*ServiceError) Error

func (e *ServiceError) Error() string

Jump to

Keyboard shortcuts

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