Documentation
¶
Index ¶
- Variables
- func DecodeCursor(after *string) (*string, error)
- func DeleteRelationField(tx *DGraphTxn, ctx context.Context, model interface{}, fieldName string, ...) error
- func EncodeCursor(i *string) graphql.ID
- func SaveBinder(tx *DGraphTxn, ctx context.Context, binder *ModelBinder) (*validate.Errors, error)
- func UpdateSchema(tx *DGraphTxn, ctx context.Context, model interface{}, commit bool) error
- type BaseAfterDestroy
- type BaseAfterSavable
- type BaseAfterSaveableRelation
- type BaseBeforeDestroy
- type BaseBinderValidatable
- type BasePreValidatable
- type BinderBaseModel
- type DGraphTxn
- func (d *DGraphTxn) Associate(ctx context.Context, id string, relation string, relatedID string, commit bool) (*api.Assigned, error)
- func (d *DGraphTxn) Commit(ctx context.Context) error
- func (d *DGraphTxn) DeleteByUID(ctx context.Context, uid string, commit bool) (*api.Assigned, error)
- func (d *DGraphTxn) Discard(ctx context.Context) error
- func (d *DGraphTxn) Mutate(ctx context.Context, mu *api.Mutation) (*api.Assigned, error)
- func (d *DGraphTxn) MutateDelete(ctx context.Context, raw string, commit bool) (*api.Assigned, error)
- func (d *DGraphTxn) MutateDeleteField(ctx context.Context, id string, field string, value *api.Value, commit bool) (*api.Assigned, error)
- func (d *DGraphTxn) MutateField(ctx context.Context, id string, fieldName string, value interface{}, ...) (*api.Assigned, error)
- func (d *DGraphTxn) MutateSet(ctx context.Context, sets []*api.NQuad, commit bool) (*api.Assigned, error)
- func (d *DGraphTxn) QueryWithVars(ctx context.Context, q string, qVars map[string]string) (*api.Response, error)
- func (d *DGraphTxn) Save(ctx context.Context, data interface{}, commit bool) (*api.Assigned, error)
- func (d *DGraphTxn) Schema(ctx context.Context, schema string) error
- func (d *DGraphTxn) Transact(ctx context.Context) error
- type SaveCallBack
- type SaveHelper
Constants ¶
This section is empty.
Variables ¶
View Source
var DebugSchema = true
Functions ¶
func DecodeCursor ¶
func DeleteRelationField ¶
func EncodeCursor ¶
func SaveBinder ¶
Types ¶
type BaseAfterDestroy ¶
type BaseAfterSavable ¶
type BaseBeforeDestroy ¶
type BaseBinderValidatable ¶
type BasePreValidatable ¶
type BinderBaseModel ¶
type DGraphTxn ¶
func NewDGraphTxn ¶
func NewDGraphTxn(connection *grpc.ClientConn) *DGraphTxn
func (*DGraphTxn) Associate ¶
func (d *DGraphTxn) Associate(ctx context.Context, id string, relation string, relatedID string, commit bool) (*api.Assigned, error)
create relation from "id" by relation(name/predicate) to "relatedID"
func (*DGraphTxn) DeleteByUID ¶
func (d *DGraphTxn) DeleteByUID(ctx context.Context, uid string, commit bool) (*api.Assigned, error)
Delete an object by id
func (*DGraphTxn) MutateDelete ¶
func (d *DGraphTxn) MutateDelete(ctx context.Context, raw string, commit bool) (*api.Assigned, error)
delete {
<0xf11168064b01135b> <died> "1998" .
}
func (*DGraphTxn) MutateDeleteField ¶
func (d *DGraphTxn) MutateDeleteField(ctx context.Context, id string, field string, value *api.Value, commit bool) (*api.Assigned, error)
ctx
id object id predicate value (nil / api.Value optional) - nil means * commit bool
func (*DGraphTxn) MutateField ¶
func (d *DGraphTxn) MutateField(ctx context.Context, id string, fieldName string, value interface{}, commit bool) (*api.Assigned, error)
Set value for a predicate by object ID
func (*DGraphTxn) MutateSet ¶
func (*DGraphTxn) QueryWithVars ¶
type SaveCallBack ¶
type SaveCallBack func(*ModelBinder) error
type SaveHelper ¶
type SaveHelper struct {
// contains filtered or unexported fields
}
func Save ¶
func Save(tx *DGraphTxn, ctx context.Context, dataModel interface{}, values map[string]interface{}, queryFields ...QueryField) *SaveHelper
func SaveIfNotExist ¶
func SaveIfNotExist(tx *DGraphTxn, ctx context.Context, dataModel interface{}, values map[string]interface{}, where string, whereValues map[string]QVar, queryFields ...QueryField) *SaveHelper
@param tx @param ctx @param modelbinder @param string the where condition @param variables for the where condition @param queryFields - to obtain if exists @return model, created t/f, validation errors, error
func (*SaveHelper) On ¶
func (s *SaveHelper) On(event string, callback SaveCallBack) *SaveHelper
Click to show internal directories.
Click to hide internal directories.