mrenum

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemStatus

type ItemStatus uint8

ItemStatus - статус элемента.

const (
	ItemStatusDraft    ItemStatus = iota + 1 // черновик
	ItemStatusEnabled                        // действующий
	ItemStatusDisabled                       // отключённый
)

Статусы элемента.

func ParseItemStatusList

func ParseItemStatusList(items []string) ([]ItemStatus, error)

ParseItemStatusList - парсит массив строковых значений и возвращает соответствующий массив enum значений.

func (ItemStatus) MarshalJSON

func (e ItemStatus) MarshalJSON() ([]byte, error)

MarshalJSON - переводит enum значение в строковое представление.

func (*ItemStatus) ParseAndSet

func (e *ItemStatus) ParseAndSet(value string) error

ParseAndSet - парсит указанное значение и если оно валидно, то устанавливает его числовое значение.

func (*ItemStatus) Scan

func (e *ItemStatus) Scan(value any) error

Scan implements the Scanner interface.

func (*ItemStatus) Set added in v0.9.7

func (e *ItemStatus) Set(value uint8) error

Set - устанавливает указанное значение, если оно является enum значением.

func (ItemStatus) String

func (e ItemStatus) String() string

String - возвращает значение в виде строки.

func (*ItemStatus) UnmarshalJSON

func (e *ItemStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON - переводит строковое значение в enum представление.

func (ItemStatus) Value

func (e ItemStatus) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

Jump to

Keyboard shortcuts

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