diff

package
v0.0.0-...-6d0a47e Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Type          ActionType
	CategoryTitle string
	FeedURL       string
}

Action represents an action to be performed to sync the local and remote state.

func CalculateDiff

func CalculateDiff(local *State, remote *State) ([]Action, error)

CalculateDiff calculates the differences between the local and remote state and returns the actions to be performed.

type ActionSorter

type ActionSorter []Action

ActionSorter sorts actions by type and then by relevant fields within each type.

func (ActionSorter) Len

func (a ActionSorter) Len() int

Len implements the sort.Interface.

func (ActionSorter) Less

func (a ActionSorter) Less(i int, j int) bool

Less implements the sort.Interface.

func (ActionSorter) Swap

func (a ActionSorter) Swap(i int, j int)

Swap implements the sort.Interface.

type ActionType

type ActionType string

ActionType represents the type of action to be performed.

const (
	// CreateCategory represents an action to create a category.
	CreateCategory ActionType = "CreateCategory"

	// CreateFeed represents an action to create a feed.
	CreateFeed ActionType = "CreateFeed"

	// DeleteCategory represents an action to delete a category.
	DeleteCategory ActionType = "DeleteCategory"

	// DeleteFeed represents an action to delete a feed.
	DeleteFeed ActionType = "DeleteFeed"
)

type State

type State struct {
	FeedURLsByCategoryTitle map[string][]string
}

State represents either the current remote state of Miniflux, or the intended local state of Miniflux.

func (State) CategoryExists

func (s State) CategoryExists(categoryTitle string) bool

CategoryExists checks if a category exists in the state.

func (State) CategoryTitles

func (s State) CategoryTitles() []string

CategoryTitles returns a list of all category titles in the state.

func (State) FeedExists

func (s State) FeedExists(feedURL string, categoryTitle string) bool

FeedExists checks if a feed URL exists in a specific category.

func (State) FeedURLs

func (s State) FeedURLs() []string

FeedURLs returns a list of all feed URLs in the state.

Jump to

Keyboard shortcuts

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