types

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDateFormat = "2006-01-02 15:04:05"

Variables

View Source
var ErrRecordNotFound = errors.New("record not found")
View Source
var RoleToString = map[Role]string{
	Nil:   "Nil",
	Admin: "Admin",
	User:  "User",
}
View Source
var StringToRole = map[string]Role{
	"Nil":   Nil,
	"Admin": Admin,
	"User":  User,
}

Functions

func ErrIsUserError

func ErrIsUserError(err error) bool

func RoleFromString

func RoleFromString(roleStr string) (string, error)

Types

type AppSettings

type AppSettings interface {
	MarshalJSON() ([]byte, error)
	UnmarshalJSON([]byte) error
}

type DatabaseType

type DatabaseType int
const (
	DatabasePostgres DatabaseType = iota
	GoogleCloudsqlPostgres
	DatabaseSqlite
)

type DateTime

type DateTime struct {
	// contains filtered or unexported fields
}

func NowDateTime

func NowDateTime() DateTime

func ParseDateTime

func ParseDateTime(value any) (DateTime, error)

func (DateTime) MarshalJSON

func (d DateTime) MarshalJSON() ([]byte, error)

func (*DateTime) Scan

func (d *DateTime) Scan(value any) error

func (DateTime) String

func (d DateTime) String() string

func (DateTime) Time

func (d DateTime) Time() time.Time

func (*DateTime) UnmarshalJSON

func (d *DateTime) UnmarshalJSON(b []byte) error

func (DateTime) Value

func (d DateTime) Value() (driver.Value, error)

type EventClient

type EventClient string
const (
	GcloudPubSubClient   EventClient = "GcloudPubSub"
	AWSEventBridgeClient EventClient = "AWSEventBridgeClient"
	AWSSQSClient         EventClient = "AWSSQSClient"
)

type FieldError

type FieldError struct {
	Field   string `json:"field"`
	Message string `json:"message"`
}

type RequestBodyError

type RequestBodyError struct {
	Message string
	Errors  []FieldError
}

func (*RequestBodyError) Error

func (r *RequestBodyError) Error() string

type Role

type Role int
const (
	Nil Role = iota
	Admin
	User
)

func (Role) MarshalJSON

func (r Role) MarshalJSON() ([]byte, error)

MarshalJSON converts the Role to its corresponding string representation for JSON serialization.

func (*Role) UnmarshalJSON

func (r *Role) UnmarshalJSON(data []byte) error

UnmarshalJSON converts a JSON string to the corresponding Role value.

type SystemError

type SystemError struct {
	Message string
}

func (*SystemError) Error

func (s *SystemError) Error() string

type UserError

type UserError struct {
	Message string
}

func (*UserError) Error

func (u *UserError) Error() string

Jump to

Keyboard shortcuts

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