sync

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package sync provides a way to synchronize items from a source to the server.

Index

Constants

View Source
const (
	MetadataKeySyncID     = "sync_id"
	MetadataKeySyncSource = "sync_source"
)
View Source
const (
	HeaderSyncID = "X-Sync-Id"
)

Variables

View Source
var (
	ErrUnexpectedStatusCode = errors.New("unexpected status code")
)

Functions

This section is empty.

Types

type ID

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

func NewSyncID

func NewSyncID() *ID

func ParseSyncID

func ParseSyncID(id string) *ID

func (*ID) Intercept

func (s *ID) Intercept(_ context.Context, req *http.Request) error

Intercept will attach an X-Sync-Id header to the request and ensures that the sync ID is attached to the header.

func (*ID) String

func (s *ID) String() string

type Syncer

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

Syncer synchronizes items from a source to the server.

func NewSyncer

func NewSyncer(
	id *ID,
	sourcer sourcer.Sourcer,
	c *api.ClientWithResponses,
	l *slog.Logger,
	config *parser.Config,
) (*Syncer, error)

NewSyncer returns a new syncer.

func (*Syncer) Sync

func (s *Syncer) Sync(ctx context.Context, livemode bool) error

Sync synchronizes items from a source to the server.

Jump to

Keyboard shortcuts

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