Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diff ¶
type Diff struct { Inserted []*PredicateSchema Deleted []*PredicateSchema Modified []*ModifiedPredicate }
Diff represents a changes in 2 schemata
type ModifiedPredicate ¶
type ModifiedPredicate struct {
From, To *PredicateSchema
}
ModifiedPredicate represents a changes in 2 predicates
type PredicateSchema ¶
type PredicateSchema struct { Name string Type PredicateType Tokenizers []string Index bool Reverse bool Count bool List bool }
PredicateSchema represents predicate schema in Dgraph.
func (*PredicateSchema) String ¶
func (s *PredicateSchema) String() string
type PredicateType ¶
type PredicateType int
PredicateType represents schema types in Dgraph.
const ( PredicateTypeDefault PredicateType = iota PredicateTypeInt PredicateTypeFloat PredicateTypeString PredicateTypeBool PredicateTypeDateTime PredicateTypeGeo PredicateTypePassword PredicateTypeUID )
PredicateType enum values See https://docs.dgraph.io/query-language/#schemav
func PredicateTypeOf ¶
func PredicateTypeOf(name string) (PredicateType, error)
PredicateTypeOf returns PredicateType corresponds to given name
func (PredicateType) String ¶
func (t PredicateType) String() string
type Repository ¶
type Repository interface { GetSchema(context.Context) (*Schema, error) Update(context.Context, *Diff) error }
Repository is an interface for operating Dgraph schema.
type Schema ¶
type Schema struct {
Predicates []*PredicateSchema
}
Schema represents predicate schemata in Dgrpah.
func (*Schema) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*Schema) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler
Click to show internal directories.
Click to hide internal directories.