storage

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidStatus = fmt.Errorf("not a valid Status, try [%s]", strings.Join(_StatusNames, ", "))

Functions

func StatusNames added in v0.0.3

func StatusNames() []string

StatusNames returns a list of possible string values of Status.

Types

type Celestial

type Celestial struct {
	bun.BaseModel `bun:"celestial" comment:"Table with celestial ids."`

	Id        string `bun:"id,pk,notnull"                 comment:"Celestial id"`
	AddressId uint64 `bun:"address_id"                    comment:"Internal address identity for connected address"`
	ImageUrl  string `bun:"image_url"                     comment:"Image url"`
	ChangeId  int64  `bun:"change_id"                     comment:"Id of the last change of celestial id"`
	Status    Status `bun:"status,type:celestials_status" comment:"Status of celestial domain"`
}

func (Celestial) String

func (cid Celestial) String() string

func (Celestial) TableName

func (Celestial) TableName() string

type CelestialState

type CelestialState struct {
	bun.BaseModel `bun:"celestial_state" comment:"Table with celestial ids."`

	Name     string `bun:"name,pk,notnull" comment:"Celestial id indexer name"`
	ChangeId int64  `bun:"change_id"       comment:"Id of the last change of celestial id"`
}

func (CelestialState) String

func (cid CelestialState) String() string

func (CelestialState) TableName

func (CelestialState) TableName() string

type CelestialTransaction

type CelestialTransaction interface {
	SaveCelestials(ctx context.Context, celestials iter.Seq[Celestial]) error
	UpdateState(ctx context.Context, state *CelestialState) error
	UpdateStatusForAddress(ctx context.Context, addressId ...iter.Seq[uint64]) error

	sdk.Transaction
}

type ICelestial

type ICelestial interface {
	ById(ctx context.Context, id string) (Celestial, error)
	ByAddressId(ctx context.Context, addressId uint64, limit, offset int) ([]Celestial, error)
	Primary(ctx context.Context, addressId uint64) (Celestial, error)
}

type ICelestialState

type ICelestialState interface {
	ByName(ctx context.Context, name string) (CelestialState, error)
	Save(ctx context.Context, state *CelestialState) error
}

type Status added in v0.0.3

type Status string

swagger:enum Status

ENUM(
	NOT_VERIFIED,
	VERIFIED,
	PRIMARY
)
const (
	// StatusNOTVERIFIED is a Status of type NOT_VERIFIED.
	StatusNOTVERIFIED Status = "NOT_VERIFIED"
	// StatusVERIFIED is a Status of type VERIFIED.
	StatusVERIFIED Status = "VERIFIED"
	// StatusPRIMARY is a Status of type PRIMARY.
	StatusPRIMARY Status = "PRIMARY"
)

func ParseStatus added in v0.0.3

func ParseStatus(name string) (Status, error)

ParseStatus attempts to convert a string to a Status.

func StatusValues added in v0.0.3

func StatusValues() []Status

StatusValues returns a list of the values for Status

func (Status) IsValid added in v0.0.3

func (x Status) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Status) MarshalText added in v0.0.3

func (x Status) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (*Status) Scan added in v0.0.3

func (x *Status) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (Status) String added in v0.0.3

func (x Status) String() string

String implements the Stringer interface.

func (*Status) UnmarshalText added in v0.0.3

func (x *Status) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

func (Status) Value added in v0.0.3

func (x Status) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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