entity

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SortOrderAsc  = "ASC"
	SortOrderDesc = "DESC"
	OrderByID     = "id"
)

Variables

View Source
var (
	DefaultSortOrder = SortOrderAsc
	DefaultPageSize  = int32(0)
	DefaultOrderBy   = OrderByID
)

Functions

This section is empty.

Types

type BaseEntity

type BaseEntity[T any] struct {
	ID               *int32
	TypeID           *int32
	Attributes       *T
	Properties       *[]Properties
	CustomProperties *[]Properties
}

func (*BaseEntity[T]) GetAttributes

func (r *BaseEntity[T]) GetAttributes() *T

func (*BaseEntity[T]) GetCustomProperties

func (r *BaseEntity[T]) GetCustomProperties() *[]Properties

func (*BaseEntity[T]) GetID

func (r *BaseEntity[T]) GetID() *int32

func (*BaseEntity[T]) GetProperties

func (r *BaseEntity[T]) GetProperties() *[]Properties

func (*BaseEntity[T]) GetTypeID

func (r *BaseEntity[T]) GetTypeID() *int32

func (*BaseEntity[T]) SetID

func (r *BaseEntity[T]) SetID(n int32)

func (*BaseEntity[T]) SetTypeID

func (r *BaseEntity[T]) SetTypeID(n int32)

type Entity

type Entity[T any] interface {
	GetID() *int32
	SetID(int32)
	GetTypeID() *int32
	SetTypeID(int32)
	GetAttributes() *T
	GetProperties() *[]Properties
	GetCustomProperties() *[]Properties
}

type ListWrapper

type ListWrapper[T any] struct {
	Items         []T
	NextPageToken string
	PageSize      int32
	Size          int32
}

type Pagination

type Pagination struct {
	PageSize      *int32  `json:"pageSize,omitempty"`
	OrderBy       *string `json:"orderBy,omitempty"`
	SortOrder     *string `json:"sortOrder,omitempty"`
	NextPageToken *string `json:"nextPageToken,omitempty"`
	FilterQuery   *string `json:"filterQuery,omitempty"`
}

func (*Pagination) GetFilterQuery

func (p *Pagination) GetFilterQuery() string

func (*Pagination) GetNextPageToken

func (p *Pagination) GetNextPageToken() string

func (*Pagination) GetOrderBy

func (p *Pagination) GetOrderBy() string

func (*Pagination) GetPageSize

func (p *Pagination) GetPageSize() int32

func (*Pagination) GetSortOrder

func (p *Pagination) GetSortOrder() string

func (*Pagination) SetNextPageToken

func (p *Pagination) SetNextPageToken(token *string)

type Properties

type Properties struct {
	Name             string
	IsCustomProperty bool
	IntValue         *int32
	DoubleValue      *float64
	StringValue      *string
	BoolValue        *bool
	ByteValue        *[]byte
	ProtoValue       *[]byte
}

func NewBoolProperty

func NewBoolProperty(name string, value bool, isCustom bool) Properties

func NewByteProperty

func NewByteProperty(name string, value []byte, isCustom bool) Properties

func NewDoubleProperty

func NewDoubleProperty(name string, value float64, isCustom bool) Properties

func NewIntProperty

func NewIntProperty(name string, value int32, isCustom bool) Properties

func NewStringProperty

func NewStringProperty(name string, value string, isCustom bool) Properties

func (*Properties) SetInt64Value

func (p *Properties) SetInt64Value(n int64)

type Type

type Type interface {
	GetID() *int32
	GetAttributes() *TypeAttributes
}

type TypeAttributes

type TypeAttributes struct {
	Name        *string
	Version     *string
	TypeKind    *int32
	Description *string
	InputType   *string
	OutputType  *string
	ExternalID  *string
}

type TypeImpl

type TypeImpl struct {
	ID         *int32
	Attributes *TypeAttributes
}

func (*TypeImpl) GetAttributes

func (t *TypeImpl) GetAttributes() *TypeAttributes

func (*TypeImpl) GetID

func (t *TypeImpl) GetID() *int32

type TypeProperty

type TypeProperty interface {
	GetTypeID() int32
	GetName() string
	GetDataType() *int32
}

type TypePropertyImpl

type TypePropertyImpl struct {
	TypeID   int32
	Name     string
	DataType *int32
}

func (*TypePropertyImpl) GetDataType

func (tp *TypePropertyImpl) GetDataType() *int32

func (*TypePropertyImpl) GetName

func (tp *TypePropertyImpl) GetName() string

func (*TypePropertyImpl) GetTypeID

func (tp *TypePropertyImpl) GetTypeID() int32

type TypePropertyRepository

type TypePropertyRepository interface {
	Save(tp TypeProperty) (TypeProperty, error)
}

type TypeRepository

type TypeRepository interface {
	GetAll() ([]Type, error)
	Save(t Type) (Type, error)
}

Jump to

Keyboard shortcuts

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