model

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeEvent

type ChangeEvent struct {
	ID                string             `avro:"_id" bson:"_id" json:"_id"`
	OperationType     string             `avro:"operationType" bson:"operation_type" json:"operation_type"`
	FullDocument      []byte             `avro:"fullDocument" bson:"full_document" json:"full_document"`
	DocumentKey       string             `avro:"documentKey" bson:"document_key" json:"document_key"`
	UpdateDescription *UpdateDescription `avro:"updateDescription" bson:"update_description" json:"update_description"`
	Namespace         Namespace          `avro:"ns" bson:"namespace" json:"namespace"`
	To                *Namespace         `avro:"to" bson:"to" json:"to"`
}

ChangeEvent is a struct that represents a change stream event.

func (ChangeEvent) Avro

func (c ChangeEvent) Avro() ([]byte, error)

Avro returns the avro encoded byte array of the change stream event.

func (ChangeEvent) JSON

func (c ChangeEvent) JSON() ([]byte, error)

JSON returns the json encoded byte array of the change stream event.

type Namespace

type Namespace struct {
	DB   string `avro:"db" bson:"db" json:"db"`
	Coll string `avro:"coll" bson:"coll" json:"coll"`
}

Namespace is a struct that represents a namespace of change stream event.

type UpdateDescription

type UpdateDescription struct {
	UpdatedFields string `avro:"updatedFields" bson:"updated_fields" json:"updated_fields"`
	RemovedFields string `avro:"removedFields" bson:"removed_fields" json:"removed_fields"`
}

UpdateDescription is a struct that represents an update description of change stream event.

Jump to

Keyboard shortcuts

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