model

package
v0.0.0-...-d88ec87 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//ACLCopyFromSource indicates that the destination object's ACL should be the same as source object's
	ACLCopyFromSource ACLMode = "copy_src"
	//ACLNone indicates that the destination object's ACL shouldn't be explicitly specified by the migrator
	ACLNone ACLMode = "none"

	// ActionMove object will be copied and removed
	ActionMove = "move"
	// ActionCopy object will be copied
	ActionCopy = "copy"
	// ActionDelete object will be removed
	ActionDelete = "delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLMode

type ACLMode string

ACLMode indicates how the acl of the destination object should be set

type ErrorType

type ErrorType = string

ErrorType denotes model errors

const (
	TaskError        ErrorType = "task_error"
	CredentialsError ErrorType = "credentials_error"
	PermissionsError ErrorType = "permissions_error"
	SourceError      ErrorType = "source_error"
	DestinationError ErrorType = "destination_error"
)

Common task error

type Hook

type Hook = func(record *watchdog.ConsistencyRecord, err error) error

type JSONNullInt64

type JSONNullInt64 struct {
	sql.NullInt64
}

JSONNullInt64 wraps sql.NullInt64 and implements json.UnmarshalJSON interface

func (*JSONNullInt64) UnmarshalJSON

func (jni64 *JSONNullInt64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.UnmarshalJSON interface

type JSONNullString

type JSONNullString struct {
	sql.NullString
}

JSONNullString wraps sql.NullString and implements json.UnmarshalJSON interface

func (*JSONNullString) UnmarshalJSON

func (jnstr *JSONNullString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.UnmarshalJSON interface

type MigrationTaskItem

type MigrationTaskItem struct {
	HostPortFrom  string         `db:"hostport_from" json:"hostPortFrom" csv:"hostPortFrom"`
	HostPortTo    string         `db:"hostport_to" json:"hostPortTo" csv:"hostPortTo"`
	KeyFrom       string         `db:"key_from" json:"keyFrom" csv:"keyFrom"`
	KeyTo         string         `db:"key_to" json:"keyTo" csv:"keyTo"`
	Action        string         `db:"action" json:"action" csv:"action"`
	Status        string         `db:"status"`
	LastUpdate    pq.NullTime    `db:"last_update" json:"lastUpdate,omitempty"`
	AccessKeyFrom JSONNullString `db:"accesskey_from" json:"access-key" csv:"accessKeyFrom"`
	AccessKeyTo   JSONNullString `db:"accesskey_to" json:"access-key-to" csv:"accessKeyTo"`
	Pid           JSONNullInt64  `db:"pid" json:"pid,omitempty"`
	Mid           JSONNullString `db:"mid" json:"mid,omitempty"`
	NowToDateDiff float64        `db:"now_to_date_diff"`
	Tid           uint64         `db:"tid"`
	IsPermanent   bool           `db:"is_permanent" json:"is_permanent,omitempty"`
	SrcRm         bool
	ACLMode       ACLMode `db:"acl_mode"`
}

MigrationTaskItem working struct

type WALEntry

type WALEntry struct {
	Record              *watchdog.ConsistencyRecord
	RecordProcessedHook Hook
}

WALEntry is an entry of the log that describes the object's lifecycle

type WALTask

type WALTask struct {
	SourceClient        *s3.S3
	DestinationsClients []*s3.S3
	WALEntry            *WALEntry
}

WALTask represents a migration that has to be performed in order for the object to be in sync

Jump to

Keyboard shortcuts

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