sync

package
v0.0.0-...-ae87ca3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RemoteSourceNotSupportedError = errors.New("Source not implemented")
	InvalidRemoteConfigError      = errors.New("Invalid remote config")
	SessionRepositoryNotSetError  = errors.New("Session repository not set")
)

Functions

func DetectDeletedSessions

func DetectDeletedSessions(sessions *[]models.Session, editedSessions *[]models.Session) []models.Session

func GetConflicts

func GetConflicts(localSessions, remoteSessions []models.Session) (*bytes.Buffer, error)

Types

type ConflictingSessions

type ConflictingSessions struct {
	Local  []models.Session
	Remote []models.Session
}

type PushSummary

type PushSummary struct {
	Added   int
	Updated int
	Errors  []error
}

type SheetsSyncSource

type SheetsSyncSource struct {
	Sheet             *sheets.Sheet
	SessionRepository repositories.SessionRepository
	// contains filtered or unexported fields
}

func (*SheetsSyncSource) Pull

func (s *SheetsSyncSource) Pull() ([]models.Session, error)

func (*SheetsSyncSource) Push

func (s *SheetsSyncSource) Push(sessions *[]models.Session) (PushSummary, error)

func (*SheetsSyncSource) Type

func (s *SheetsSyncSource) Type() string

type SyncSource

type SyncSource interface {
	Type() string
	Pull() ([]models.Session, error)
	Push(*[]models.Session) (PushSummary, error)
}

func NewSource

func NewSource(remoteConfig config.Remote, sessionRepository repositories.SessionRepository) (SyncSource, error)

Directories

Path Synopsis
adapters

Jump to

Keyboard shortcuts

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