sync

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: Apache-2.0 Imports: 3 Imported by: 7

Documentation

Index

Constants

View Source
const (
	PendingStatus = "pending"
	DoneStatus    = "done"
)
View Source
const (
	CreateAction = "create"
	UpdateAction = "update"
	DeleteAction = "delete"

	Default = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	ID           string            `json:"id" bson:"id"`
	Domain       string            `json:"domain" bson:"domain"`
	Project      string            `json:"project" bson:"project"`
	ResourceType string            `json:"resource_type" bson:"resource_type"`
	Resource     []byte            `json:"resource" bson:"resource"`
	Opts         map[string]string `json:"opts" bson:"opts"`
	Action       string            `json:"action" bson:"action"`
	Timestamp    int64             `json:"timestamp" bson:"timestamp"`
	Status       string            `json:"status" bson:"status"`
}

Task is db struct to store sync task

func NewTask

func NewTask(domain, project, action, resourceType string, resource interface{}) (*Task, error)

NewTask return task with domain, project , action , resourceType and resource

type Tombstone

type Tombstone struct {
	ResourceID   string `json:"resource_id" bson:"resource_id"`
	ResourceType string `json:"resource_type" bson:"resource_type"`
	Domain       string `json:"domain" bson:"domain"`
	Project      string `json:"project" bson:"project"`
	Timestamp    int64  `json:"timestamp" bson:"timestamp"`
}

Tombstone is db struct to store the deleted resource information

func NewTombstone

func NewTombstone(domain, project, resourceType, resourceID string) *Tombstone

NewTombstone return tombstone with resourceID,resourceType ,domain and project

Jump to

Keyboard shortcuts

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