sync

package
v0.0.0-...-1f23d19 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KIND_ACL_PUT                = "ACLPut"
	KIND_LOGIN_ADDED            = "LoginAdded"
	KIND_LOGIN_NAME_CHANGED     = "LoginNameChanged"
	KIND_LOGIN_NOTES_CHANGED    = "LoginNotesChanged"
	KIND_LOGIN_PASSWORD_CHANGED = "LoginPasswordChanged"
	KIND_LOGIN_URL_ADDED        = "LoginURLAdded"
	KIND_LOGIN_URL_REMOVED      = "LoginURLRemoved"
	KIND_LOGIN_USERNAME_CHANGED = "LoginUsernameChanged"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventDTO

type EventDTO struct {
	Kind     string    `json:"kind"`
	ID       string    `json:"id"`
	Version  int       `json:"version"`
	At       time.Time `json:"at"`
	Username string    `json:"username"`
	Mode     int       `json:"mode"`
	Name     string    `json:"name"`
	Notes    string    `json:"notes"`
	Password string    `json:"password"`
	Expiry   time.Time `json:"expiry"`
	URL      string    `json:"url"`
}

type Mapper

type Mapper interface {
	ToDTOMapper
	ToEventMapper
}

func NewMapper

func NewMapper() Mapper

type PullDTO

type PullDTO struct {
	ID      string `json:"id"`
	Version int    `json:"version"`
}

type Puller

type Puller interface {
	Pull(context.Context, PullDTO) ([]EventDTO, error)
}

type PushDTO

type PushDTO struct {
	ID     string     `json:"id"`
	Events []EventDTO `json:"events"`
}

type Pusher

type Pusher interface {
	Push(context.Context, PushDTO) error
}

type Service

type Service interface {
	Pusher
	Puller
}

func New

func New(vaultRepo vault.Repository) Service

type ToDTOMapper

type ToDTOMapper interface {
	ToDTO(vault.Event) (EventDTO, error)
}

type ToEventMapper

type ToEventMapper interface {
	ToEvent(EventDTO) (vault.Event, error)
}

Jump to

Keyboard shortcuts

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