view

package
v0.0.0-...-7d6b287 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewID = id.NewViewID
View Source
var NewModelID = id.NewModelID
View Source
var NewProjectID = id.NewProjectID
View Source
var NewSchemaID = id.NewSchemaID

Functions

This section is empty.

Types

type AndCondition

type AndCondition struct {
	Conditions []Condition
}

type BasicCondition

type BasicCondition struct {
	Field FieldSelector
	Op    BasicOperator
	Value any
}

type BasicOperator

type BasicOperator string
const (
	BasicOperatorEquals    BasicOperator = "EQUALS"
	BasicOperatorNotEquals BasicOperator = "NOT_EQUALS"
)

type BoolCondition

type BoolCondition struct {
	Field FieldSelector
	Op    BoolOperator
	Value bool
}

type BoolOperator

type BoolOperator string
const (
	BoolOperatorEquals    BoolOperator = "EQUALS"
	BoolOperatorNotEquals BoolOperator = "NOT_EQUALS"
)

type Buildr

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

func New

func New() *Buildr

func (*Buildr) Build

func (b *Buildr) Build() (*View, error)

func (*Buildr) Columns

func (b *Buildr) Columns(columns *ColumnList) *Buildr

func (*Buildr) Filter

func (b *Buildr) Filter(filter *Condition) *Buildr

func (*Buildr) ID

func (b *Buildr) ID(id ID) *Buildr

func (*Buildr) Model

func (b *Buildr) Model(model ModelID) *Buildr

func (*Buildr) MustBuild

func (b *Buildr) MustBuild() *View

func (*Buildr) Name

func (b *Buildr) Name(name string) *Buildr

func (*Buildr) NewID

func (b *Buildr) NewID() *Buildr

func (*Buildr) Order

func (b *Buildr) Order(order int) *Buildr

func (*Buildr) Project

func (b *Buildr) Project(project ProjectID) *Buildr

func (*Buildr) Schema

func (b *Buildr) Schema(schema SchemaID) *Buildr

func (*Buildr) Sort

func (b *Buildr) Sort(sort *Sort) *Buildr

func (*Buildr) UpdatedAt

func (b *Buildr) UpdatedAt(updatedAt time.Time) *Buildr

func (*Buildr) User

func (b *Buildr) User(user UserID) *Buildr

type Column

type Column struct {
	Field   FieldSelector
	Visible bool
}

type ColumnList

type ColumnList []Column

type Condition

type Condition struct {
	ConditionType     ConditionType
	AndCondition      *AndCondition
	OrCondition       *OrCondition
	BasicCondition    *BasicCondition
	NullableCondition *NullableCondition
	MultipleCondition *MultipleCondition
	BoolCondition     *BoolCondition
	StringCondition   *StringCondition
	NumberCondition   *NumberCondition
	TimeCondition     *TimeCondition
}

func (Condition) FieldsByType

func (c Condition) FieldsByType(t FieldType) FieldSelectorList

func (Condition) ItemFields

func (c Condition) ItemFields() FieldSelectorList

func (Condition) MetaFields

func (c Condition) MetaFields() FieldSelectorList

type ConditionType

type ConditionType string
const (
	ConditionTypeAnd      ConditionType = "AND"
	ConditionTypeOr       ConditionType = "OR"
	ConditionTypeBasic    ConditionType = "BASIC"
	ConditionTypeNullable ConditionType = "NULLABLE"
	ConditionTypeMultiple ConditionType = "MULTIPLE"
	ConditionTypeBool     ConditionType = "BOOL"
	ConditionTypeString   ConditionType = "STRING"
	ConditionTypeNumber   ConditionType = "NUMBER"
	ConditionTypeTime     ConditionType = "TIME"
)

type Direction

type Direction string
const (
	DirectionAsc  Direction = "ASC"
	DirectionDesc Direction = "DESC"
)

type FieldSelector

type FieldSelector struct {
	Type FieldType
	ID   *id.FieldID
}

type FieldSelectorList

type FieldSelectorList []FieldSelector

type FieldType

type FieldType string
const (
	FieldTypeId               FieldType = "ID"
	FieldTypeCreationDate     FieldType = "CREATIONDATE"
	FieldTypeCreationUser     FieldType = "CREATIONUSER"
	FieldTypeModificationDate FieldType = "MODIFICATIONDATE"
	FieldTypeModificationUser FieldType = "MODIFICATIONUSER"
	FieldTypeStatus           FieldType = "STATUS"

	FieldTypeField     FieldType = "FIELD"
	FieldTypeMetaField FieldType = "METAFIELD"
)

type ID

type ID = id.ViewID

type IDList

type IDList = id.ViewIDList

type List

type List []*View

func (List) AreViewsInTheSameModel

func (l List) AreViewsInTheSameModel() bool

func (List) OrderByIDs

func (l List) OrderByIDs(ids id.ViewIDList) List

func (List) Ordered

func (l List) Ordered() List

func (List) Projects

func (l List) Projects() id.ProjectIDList

func (List) SortByID

func (l List) SortByID() List

type ModelID

type ModelID = id.ModelID

type MultipleCondition

type MultipleCondition struct {
	Field FieldSelector
	Op    MultipleOperator
	Value []any
}

type MultipleOperator

type MultipleOperator string
const (
	MultipleOperatorIncludesAny    MultipleOperator = "INCLUDES_ANY"
	MultipleOperatorNotIncludesAny MultipleOperator = "NOT_INCLUDES_ANY"
	MultipleOperatorIncludesAll    MultipleOperator = "INCLUDES_ALL"
	MultipleOperatorNotIncludesAll MultipleOperator = "NOT_INCLUDES_ALL"
)

type NullableCondition

type NullableCondition struct {
	Field FieldSelector
	Op    NullableOperator
}

type NullableOperator

type NullableOperator string
const (
	NullableOperatorEmpty    NullableOperator = "EMPTY"
	NullableOperatorNotEmpty NullableOperator = "NOT_EMPTY"
)

type NumberCondition

type NumberCondition struct {
	Field FieldSelector
	Op    NumberOperator
	Value float64
}

type NumberOperator

type NumberOperator string
const (
	NumberOperatorGreaterThan          NumberOperator = "GREATER_THAN"
	NumberOperatorLessThan             NumberOperator = "LESS_THAN"
	NumberOperatorGreaterThanOrEqualTo NumberOperator = "GREATER_THAN_OR_EQUAL_TO"
	NumberOperatorLessThanOrEqualTo    NumberOperator = "LESS_THAN_OR_EQUAL_TO"
)

type OrCondition

type OrCondition struct {
	Conditions []Condition
}

type ProjectID

type ProjectID = id.ProjectID

type SchemaID

type SchemaID = id.SchemaID

type Sort

type Sort struct {
	Field     FieldSelector
	Direction Direction
}

type StringCondition

type StringCondition struct {
	Field FieldSelector
	Op    StringOperator
	Value string
}

type StringOperator

type StringOperator string
const (
	StringOperatorContains      StringOperator = "CONTAINS"
	StringOperatorNotContains   StringOperator = "NOT_CONTAINS"
	StringOperatorStartsWith    StringOperator = "STARTS_WITH"
	StringOperatorEndsWith      StringOperator = "ENDS_WITH"
	StringOperatorNotStartsWith StringOperator = "NOT_STARTS_WITH"
	StringOperatorNotEndsWith   StringOperator = "NOT_ENDS_WITH"
)

type TimeCondition

type TimeCondition struct {
	Field FieldSelector
	Op    TimeOperator
	Value time.Time
}

type TimeOperator

type TimeOperator string
const (
	TimeOperatorBefore      TimeOperator = "BEFORE"
	TimeOperatorAfter       TimeOperator = "AFTER"
	TimeOperatorBeforeOrOn  TimeOperator = "BEFORE_OR_ON"
	TimeOperatorAfterOrOn   TimeOperator = "AFTER_OR_ON"
	TimeOperatorOfThisWeek  TimeOperator = "OF_THIS_WEEK"
	TimeOperatorOfThisMonth TimeOperator = "OF_THIS_MONTH"
	TimeOperatorOfThisYear  TimeOperator = "OF_THIS_YEAR"
)

type UserID

type UserID = accountdomain.UserID

type View

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

func (*View) Clone

func (v *View) Clone() *View

func (*View) Columns

func (v *View) Columns() *ColumnList

func (*View) Filter

func (v *View) Filter() *Condition

func (*View) ID

func (v *View) ID() ID

func (*View) Model

func (v *View) Model() ModelID

func (*View) Name

func (v *View) Name() string

func (*View) Order

func (g *View) Order() int

func (*View) Project

func (v *View) Project() ProjectID

func (*View) Schema

func (v *View) Schema() SchemaID

func (*View) SetColumns

func (v *View) SetColumns(columns *ColumnList)

func (*View) SetFilter

func (v *View) SetFilter(condition *Condition)

func (*View) SetName

func (v *View) SetName(name string)

func (*View) SetOrder

func (g *View) SetOrder(order int)

func (*View) SetSort

func (v *View) SetSort(sort *Sort)

func (*View) SetUpdatedAt

func (v *View) SetUpdatedAt(now time.Time)

func (*View) Sort

func (v *View) Sort() *Sort

func (*View) UpdatedAt

func (v *View) UpdatedAt() time.Time

func (*View) User

func (v *View) User() UserID

Jump to

Keyboard shortcuts

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