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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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