config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRelativePath

func GetRelativePath() (string, string)

Types

type SyncConfig

type SyncConfig struct {
	Interval time.Duration `json:"interval"`
	Targets  []Target      `json:"targets"`
}
var (
	ServerConfig SyncConfig
)

func NewSyncConfig

func NewSyncConfig() *SyncConfig

func (*SyncConfig) AddToSync

func (c *SyncConfig) AddToSync(PathOrigin, PathDestination string, Hash string)

I hope this works with the hash

Saves the config afterwards

func (*SyncConfig) CreateConfig

func (c *SyncConfig) CreateConfig(configPath, configDir string)

func (*SyncConfig) ReadConfig

func (c *SyncConfig) ReadConfig()

func (*SyncConfig) RemoveFromSync

func (c *SyncConfig) RemoveFromSync(PathOrigin, PathDestination string)

func (*SyncConfig) ReturnInterval

func (c *SyncConfig) ReturnInterval() time.Duration

Same as above just for a different field

func (*SyncConfig) ReturnTargets

func (c *SyncConfig) ReturnTargets() []Target

Fuckass cleancode type stuff but usefull here

func (*SyncConfig) SaveConfig

func (c *SyncConfig) SaveConfig() error

func (*SyncConfig) SaveConfigUnformatted added in v0.0.2

func (c *SyncConfig) SaveConfigUnformatted() error

type Target

type Target struct {
	PathOrigin      string `json:"path-origin"`
	PathDestination string `json:"path-destination"`
	Hash            string `json:"hash"`
}

Jump to

Keyboard shortcuts

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