backupformat

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader) (*Decoder, error)

func (*Decoder) Close

func (d *Decoder) Close() error

func (*Decoder) Next

func (d *Decoder) Next() (*v1.Relationship, error)

func (*Decoder) Schema

func (d *Decoder) Schema() string

func (*Decoder) ZedToken

func (d *Decoder) ZedToken() *v1.ZedToken

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer, schema string, token *v1.ZedToken) (*Encoder, error)

func (*Encoder) Append

func (e *Encoder) Append(rel *v1.Relationship) error

func (*Encoder) Close

func (e *Encoder) Close() error

type RedactionMap added in v0.16.0

type RedactionMap struct {
	// Definitions is the map of original definition names to their redacted names.
	Definitions map[string]string

	// Caveats is the map of original caveat names to their redacted names.
	Caveats map[string]string

	// Relations is the map of original relation names to their redacted names.
	Relations map[string]string

	// ObjectIDs is the map of original object IDs to their redacted names.
	ObjectIDs map[string]string
}

RedactionMap is the map of original names to their redacted names.

func (RedactionMap) Invert added in v0.16.0

func (rm RedactionMap) Invert() RedactionMap

Invert returns the inverted redaction map, with the redacted names as the keys.

type RedactionOptions added in v0.16.0

type RedactionOptions struct {
	// RedactDefinitions will redact the definition names.
	RedactDefinitions bool

	// RedactRelations will redact the relation names.
	RedactRelations bool

	// RedactObjectIDs will redact the object IDs.
	RedactObjectIDs bool
}

RedactionOptions are the options to use when redacting data.

type Redactor added in v0.16.0

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

func NewRedactor added in v0.16.0

func NewRedactor(dec *Decoder, w io.Writer, opts RedactionOptions) (*Redactor, error)

NewRedactor creates a new redactor that will redact the data as it is written.

func (*Redactor) Close added in v0.16.0

func (r *Redactor) Close() error

func (*Redactor) Next added in v0.16.0

func (r *Redactor) Next() error

Next redacts the next record and writes it to the writer.

func (*Redactor) RedactionMap added in v0.16.0

func (r *Redactor) RedactionMap() RedactionMap

RedactionMap returns the redaction map containing the original names and their redacted names.

type RelationshipV1

type RelationshipV1 struct {
	ObjectType        string `avro:"object_type"`
	ObjectID          string `avro:"object_id"`
	Relation          string `avro:"relation"`
	SubjectObjectType string `avro:"subject_object_type"`
	SubjectObjectID   string `avro:"subject_object_id"`
	SubjectRelation   string `avro:"subject_relation"`
	CaveatName        string `avro:"caveat_name"`
	CaveatContext     []byte `avro:"caveat_context"`
}

type SchemaV1

type SchemaV1 struct {
	SchemaText string `avro:"schema_text"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳