write

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendSchemaWriter

type AppendSchemaWriter interface {
	Write(context.Context, string) error
}

AppendSchemaWriter appends a schema fragment to a spicedb schema

func NewSchemaAppendWriter

func NewSchemaAppendWriter(client *authzed.Client, discard bool) AppendSchemaWriter

type BatchingRelationshipWriter

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

BatchingRelationshipWriter writes in batches of batchSize

func (BatchingRelationshipWriter) Write

type DiscardingRelationshipWriter

type DiscardingRelationshipWriter struct{}

DiscardingRelationshipWriter does nothing but satisfy RelationshipWriter

func (DiscardingRelationshipWriter) Write

type DiscardingSchemaAppendWriter

type DiscardingSchemaAppendWriter struct{}

DiscardingSchemaAppendWriter does nothing but satisfy SchemaAppendWriter

func (DiscardingSchemaAppendWriter) Write

type DryRunSchemaAppendWriter

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

DryRunSchemaAppendWriter prints what the schema would have been.

func NewDryRunSchemaAppendWriter

func NewDryRunSchemaAppendWriter(client *authzed.Client) *DryRunSchemaAppendWriter

NewDryRunSchemaAppendWriter constructs a new schema append writer that logs but doesn't write. If client is non-nil, it will attempt to read the existing schema from spicedb; otherwise it will assume the schema is empty.

func (*DryRunSchemaAppendWriter) Write

func (w *DryRunSchemaAppendWriter) Write(ctx context.Context, schema string) error

type LoggingRelationshipWriter

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

LoggingRelationshipWriter will log each write before delegating to an underlying RelationshipWriter

func (LoggingRelationshipWriter) Write

type RelationshipWriter

type RelationshipWriter interface {
	Write(context.Context, []*v1.RelationshipUpdate) error
}

RelationshipWriter writes v1 relationships

func NewBatchingRelationshipWriter

func NewBatchingRelationshipWriter(writer RelationshipWriter, batchSize int) RelationshipWriter

NewBatchingRelationshipWriter will write relationships in batches of size batchSize

func NewDryRunRelationshipWriter

func NewDryRunRelationshipWriter() RelationshipWriter

NewDryRunRelationshipWriter constructs a new relationship writer that logs but doesn't write.

func NewRelationshipWriter

func NewRelationshipWriter(client *authzed.Client) RelationshipWriter

NewRelationshipWriter returns a relationship writer based on the current config. It will configure trace logging if the current log level is trace, and will dry-run if no client is passed.

type StdRelationshipWriter

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

StdRelationshipWriter writes via an authzed client, no-frills.

func (StdRelationshipWriter) Write

type StdSchemaAppendWriter

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

StdSchemaAppendWriter writes via an authzed client, no-frills.

func NewStdSchemaAppendWriter

func NewStdSchemaAppendWriter(client *authzed.Client) *StdSchemaAppendWriter

NewStdSchemaAppendWriter constructs a new schema append writer that logs but doesn't write.

func (*StdSchemaAppendWriter) Write

func (w *StdSchemaAppendWriter) Write(ctx context.Context, schema string) error

Jump to

Keyboard shortcuts

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