sync

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(data []byte, passphrase string) ([]byte, error)

func Encrypt

func Encrypt(plaintext []byte, passphrase string) ([]byte, error)

func GeneratePassphrase

func GeneratePassphrase() (string, error)

Types

type Peer

type Peer struct {
	Name string
	Addr string
	Port int
}

func DiscoverPeers

func DiscoverPeers(timeout time.Duration) ([]Peer, error)

func (Peer) URL

func (p Peer) URL() string

type Server

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

func NewServer

func NewServer(passphrase, profile string) *Server

func (*Server) Done

func (s *Server) Done() <-chan struct{}

func (*Server) Start

func (s *Server) Start() (int, error)

func (*Server) Stop

func (s *Server) Stop()

type SyncKey

type SyncKey struct {
	Name      string `json:"name"`
	Value     string `json:"value"`
	UpdatedAt int64  `json:"updated_at"`
}

type SyncResult

type SyncResult struct {
	Added   int
	Updated int
	Skipped int
}

func Pull

func Pull(peer Peer, passphrase string) (*SyncResult, error)

func PullDirect

func PullDirect(addr, passphrase string) (*SyncResult, error)

Jump to

Keyboard shortcuts

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