spec

package
v0.5.14 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDirectory is the default directory for the configuration file.
	DefaultDirectory = "csync"
	// DefaultPath is the default path for the configuration file.
	DefaultPath = ".csync"
	// DefaultFilename is the default filename for the configuration file.
	DefaultFilename = ".csync.yml"
)

Variables

This section is empty.

Functions

func Write

func Write(s *Spec, file string, force bool) error

Write is the write function for the spec.

Types

type App

type App struct {
	// Name ...
	Name string `yaml:"name"`
	// Files ...
	Files Files `yaml:"files"`
}

App is the configuration for the app.

func AWS

func AWS() App

AWS is the configuration for the AWS provider.

func Alacritty

func Alacritty() App

Alacritty is the configuration for the Alacritty terminal.

func Azure

func Azure() App

Azure is the configuration for the Azure CLI.

func Bartender

func Bartender() App

Bartender is the configuration for the Bartender.

func Bash

func Bash() App

Bash is the configuration for the Bash shell.

func Bat

func Bat() App

Bat is the configuration for the bat pager.

func Docker

func Docker() App

Docker ...

func Ghostty

func Ghostty() App

Ghostty is the configuration for the Ghostty terminal.

See: https://github.com/ghostty-org/ghostty

func Git

func Git() App

Git is the configuration for the git version control system.

func GnuPG

func GnuPG() App

GnuPG is the configuration for the GnuPG encryption software.

func Homebrew

func Homebrew() App

Homebrew is the configuration for the Homebrew package manager.

func Hyper

func Hyper() App

Hyper is the configuration for the Hyper terminal.

func Kubectl

func Kubectl() App

Kubectl is the configuration for the kubectl.

func List

func List() []App

List of apps.

func MacOS

func MacOS() App

MacOS is the configuration for the macOS.

func Magnet

func Magnet() App

Magnet is the configuration for the Magnet app.

func Mail

func Mail() App

Mail is the configuration for the Mail app.

func Nano

func Nano() App

Nano is the configuration file for `nano`.

func Ngrok

func Ngrok() App

Ngrok is the configuration for `ngrok“.

func Npm

func Npm() App

Npm is the configuration for the npm.

func Raycast

func Raycast() App

Raycast represents for the raycast config.

func SSH

func SSH() App

SSH is the configuration for the SSH client.

func Terminal

func Terminal() App

Terminal is the configuration for the terminal.

func Tmux

func Tmux() App

Tmux is the configuration for the tmux.

func VSCode

func VSCode() App

VSCode is the configuration for the VSCode.

func Wget

func Wget() App

Wget is the configuration for the wget downloader.

func Zsh

func Zsh() App

Zsh is the configuration for the Zsh shell.

func (*App) ToProto

func (a *App) ToProto() *proto.Application

ToProto ...

type Excludes

type Excludes []string

Excludes is the list of files to exclude.

type Files

type Files []string

Files is the list of files to sync.

type Includes

type Includes []string

Includes is the list of files to include.

type Provider

type Provider struct {
	// Name ...
	Name string `validate:"required" yaml:"name"`
	// Pathh ...
	Path string `yaml:"path"`
	// Directory ...
	Directory string `yaml:"directory"`
}

Provider is the configuration for the file provider. This provider does support local, file-based storages.

func (*Provider) GetDirectory

func (s *Provider) GetDirectory() string

GetDirectory ...

func (*Provider) GetFolder

func (p *Provider) GetFolder() (string, error)

GetFolder ...

func (*Provider) GetName

func (s *Provider) GetName() string

GetName ...

func (*Provider) GetPath

func (s *Provider) GetPath() string

GetPath ...

type Spec

type Spec struct {
	// Version is the version of the configuration file.
	Version int `yaml:"version" validate:"required,eq=1"`
	// Path is the path to the configuration file.
	Path string `yaml:"path,omitempty"`
	// Provider is the configuration for the provider.
	Provider Provider `validate:"required" yaml:"provider"`
	// Apps is a list of apps to sync.
	Apps []App `yaml:"apps,omitempty"`
	// Includes is a list of apps to include.
	Includes []string `yaml:"includes,omitempty" validate:"required_with=Excludes"`
	// Excludes is a list of apps to exclude.
	Excludes []string `yaml:"excludes,omitempty" validate:"required_with=Includes"`

	sync.Mutex `yaml:"-"`
}

Spec is the configuration file for `csync`.

func Default

func Default() *Spec

Default is the default configuration.

func (*Spec) GetApps

func (s *Spec) GetApps(defaults ...App) []App

GetApps reutrns the list of apps to sync.

func (*Spec) GetVersion

func (s *Spec) GetVersion() int

GetVersion returns the version of the configuration file.

func (*Spec) UnmarshalYAML

func (s *Spec) UnmarshalYAML(data []byte) error

UnmarshalYAML overrides the default unmarshaler for the spec.

func (*Spec) Validate

func (s *Spec) Validate() error

Validate is the validation function for the spec.

Jump to

Keyboard shortcuts

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