common_type

package
v0.0.0-...-2bab997 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer[T Value] struct {
	Answers ConceptMap[T] `json:"answers,omitempty"`
}

type Attribute

type Attribute[T Value] struct {
	Value ValueItem[T]
}

type BooleanValue

type BooleanValue struct {
	Value bool
}

type Concept

type Concept[T Value] struct {
	Concept T
}

TODO: Add Thing type

type ConceptMap

type ConceptMap[V Value] struct {
	Map          map[string]Concept[V] `json:"map,omitempty"`
	Explainables Explainables          `json:"explainables,omitempty"`
}

type ConceptMapGroup

type ConceptMapGroup[V Value] struct {
	Owner       Concept[V]      `json:"owner,omitempty"`
	ConceptMaps []ConceptMap[V] `json:"concept_maps,omitempty"`
}

type DateTimeValue

type DateTimeValue struct {
	Value int64
}

type DoubleValue

type DoubleValue struct {
	Value float64
}

type Encoding

type Encoding uint8 // 255 possible values
const (
	THING_TYPE     Encoding = 0
	ENTITY_TYPE    Encoding = 1
	RELATION_TYPE  Encoding = 2
	ATTRIBUTE_TYPE Encoding = 3
	ROLE_TYPE      Encoding = 4
)

type ExplainOpt

type ExplainOpt struct {
	Explain bool `json:"explain,omitempty"`
}

type Explainable

type Explainable struct {
	Conjunction string `json:"conjunction,omitempty"`
	ID          int64  `json:"id,omitempty"`
}

type Explainables

type Explainables struct {
	Relations  map[string]Explainable `json:"relations,omitempty"`
	Attributes map[string]Explainable `json:"attributes,omitempty"`
	Ownerships map[string]Owned       `json:"ownerships,omitempty"`
}

type Explanation

type Explanation[T Value] struct {
	Rule       Rule          `json:"rule,omitempty"`
	VarMapping VarList       `json:"var_mapping,omitempty"`
	Condition  ConceptMap[T] `json:"condition,omitempty"`
	Conclusion ConceptMap[T] `json:"conclusion,omitempty"`
}

type InferOpt

type InferOpt struct {
	Infer bool `json:"infer,omitempty"`
}

type Label

type Label struct {
	Name  *string `json:"Name,omitempty"`
	Scope *string `json:"Scope,omitempty"`
}

func NewLabel

func NewLabel(name, scope string) *Label

func (Label) GetName

func (s Label) GetName() string

func (Label) GetScope

func (s Label) GetScope() string

func (Label) HasName

func (s Label) HasName() bool

func (Label) HasScope

func (s Label) HasScope() bool

func (Label) String

func (s Label) String() string

type LongValue

type LongValue struct {
	Value int64
}

type Numeric

type Numeric[T NumericType] struct {
	Value T `json:"value,omitempty"`
}

type NumericGroup

type NumericGroup[T NumericType, V Value] struct {
	Owner   Concept[V] `json:"owner,omitempty"`
	Numeric Numeric[T] `json:"numeric,omitempty"`
}

type NumericType

type NumericType interface {
	int64 | float64 | bool
}

type Options

type Options struct {
	InferOpt                    InferOpt                    `json:"infer_opt,omitempty"`
	TraceInferenceOpt           TraceInferenceOpt           `json:"trace_inference_opt,omitempty"`
	ExplainOpt                  ExplainOpt                  `json:"explain_opt,omitempty"`
	ParallelOpt                 ParallelOpt                 `json:"parallel_opt,omitempty"`
	PrefetchSizeOpt             PrefetchSizeOpt             `json:"prefetch_size_opt,omitempty"`
	PrefetchOpt                 PrefetchOpt                 `json:"prefetch_opt,omitempty"`
	SessionIdleTimeoutOpt       SessionIdleTimeoutOpt       `json:"session_idle_timeout_opt,omitempty"`
	TransactionTimeoutOpt       TransactionTimeoutOpt       `json:"transaction_timeout_opt,omitempty"`
	SchemaLockAcquireTimeoutOpt SchemaLockAcquireTimeoutOpt `json:"schema_lock_acquire_timeout_opt,omitempty"`
	ReadAnyReplicaOpt           ReadAnyReplicaOpt           `json:"read_any_replica_opt,omitempty"`
}

type Owned

type Owned struct {
	Owned map[string]Explainable `json:"owned,omitempty"`
}

type ParallelOpt

type ParallelOpt struct {
	Parallel bool `json:"parallel,omitempty"`
}

type PrefetchOpt

type PrefetchOpt struct {
	Prefetch bool `json:"prefetch,omitempty"`
}

type PrefetchSizeOpt

type PrefetchSizeOpt struct {
	PrefetchSize bool `json:"prefetch_size,omitempty"`
}

type ReadAnyReplicaOpt

type ReadAnyReplicaOpt struct {
	ReadAnyReplica bool `json:"read_any_replica,omitempty"`
}

type Rule

type Rule struct {
	Label string `json:"label,omitempty"`
	When  string `json:"when,omitempty"`
	Then  string `json:"then,omitempty"`
}

type SchemaLockAcquireTimeoutOpt

type SchemaLockAcquireTimeoutOpt struct {
	SchemaLockAcquireTimeoutMillis bool `json:"schema_lock_acquire_timeout_millis,omitempty"`
}

type SessionIdleTimeoutOpt

type SessionIdleTimeoutOpt struct {
	SessionIdleTimeoutMillis bool `json:"session_idle_timeout_millis,omitempty"`
}

type StringValue

type StringValue struct {
	Value string
}

type Thing

type Thing[T Value] struct {
	IID      []byte       `json:"Iid,omitempty"`
	Type     Type         `json:"type,omitempty"`
	Value    ValueItem[T] `json:"value,omitempty"`
	Inferred bool         `json:"inferred,omitempty"`
}

type TraceInferenceOpt

type TraceInferenceOpt struct {
	TraceInference bool `json:"trace_inference,omitempty"`
}

type TransactionTimeoutOpt

type TransactionTimeoutOpt struct {
	TransactionTimeoutMillis bool `json:"transaction_timeout_millis,omitempty"`
}

type Type

type Type struct {
	Label     string    `json:"label"`
	Scope     string    `json:"Scope,omitempty"`
	Encoding  Encoding  `json:"encoding,omitempty"`
	ValueType ValueType `json:"value_type,omitempty"`
	Root      bool      `json:"root,omitempty"`
}

type Value

type Value interface {
	StringValue | BooleanValue | LongValue | DoubleValue | DateTimeValue
}

type ValueItem

type ValueItem[T Value] struct {
	Item T
}

func (ValueItem[T]) GetValue

func (i ValueItem[T]) GetValue() (item T)

type ValueType

type ValueType uint8 // 255 possible values
const (
	OBJECT   ValueType = 0
	BOOLEAN  ValueType = 1
	LONG     ValueType = 2
	DOUBLE   ValueType = 3
	STRING   ValueType = 4
	DATETIME ValueType = 5
)

type VarList

type VarList struct {
	Vars []string `json:"vars,omitempty"`
}

Jump to

Keyboard shortcuts

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