directory

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntireDirPath = "."
)

Variables

View Source
var (
	DefaultLegalPaths = []string{
		"{LICENSE,LICENCE,License,Licence}{,.md,.txt,.rst}",
		"{COPYRIGHT,Copyright}{,.md,.txt,.rst}",
		"{NOTICE,Notice}{,.md,.txt,.rst}",
	}
)

Functions

This section is empty.

Types

type Archive added in v0.6.0

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

func (Archive) Unpack added in v0.6.0

func (t Archive) Unpack(dstPath string) error

type Config

type Config struct {
	Path     string           `json:"path"`
	Contents []ConfigContents `json:"contents,omitempty"`
}

func (Config) Validate added in v0.4.0

func (c Config) Validate() error

type ConfigContents

type ConfigContents struct {
	Path string `json:"path"`

	Git           *ConfigContentsGit           `json:"git,omitempty"`
	GithubRelease *ConfigContentsGithubRelease `json:"githubRelease,omitempty"`
	Manual        *ConfigContentsManual        `json:"manual,omitempty"`
	Directory     *ConfigContentsDirectory     `json:"directory,omitempty"`

	IncludePaths []string `json:"includePaths,omitempty"`
	ExcludePaths []string `json:"excludePaths,omitempty"`

	// By default LICENSE/LICENCE/NOTICE/COPYRIGHT files are kept
	LegalPaths []string `json:"legalPaths,omitempty"`
}

func (ConfigContents) IsEntireDir added in v0.4.0

func (c ConfigContents) IsEntireDir() bool

func (ConfigContents) LegalPathsWithDefaults

func (c ConfigContents) LegalPathsWithDefaults() []string

func (ConfigContents) Lock added in v0.8.0

func (c ConfigContents) Lock(lockConfig LockConfigContents) error

func (ConfigContents) Validate added in v0.4.0

func (c ConfigContents) Validate() error

type ConfigContentsDirectory

type ConfigContentsDirectory struct {
	Path string `json:"path"`
}

type ConfigContentsGit

type ConfigContentsGit struct {
	URL string `json:"url"`
	Ref string `json:"ref"`
}

func (*ConfigContentsGit) Lock added in v0.8.0

func (c *ConfigContentsGit) Lock(lockConfig *LockConfigContentsGit) error

type ConfigContentsGithubRelease added in v0.6.0

type ConfigContentsGithubRelease struct {
	Slug   string `json:"slug"` // e.g. organization/repository
	Tag    string `json:"tag"`
	Latest bool   `json:"latest,omitempty"`
	URL    string `json:"url,omitempty"`

	Checksums                     map[string]string `json:"checksums,omitempty"`
	DisableAutoChecksumValidation bool              `json:"disableAutoChecksumValidation,omitempty"`

	UnpackArchive *ConfigContentsUnpackArchive `json:"unpackArchive,omitempty"`
}

func (*ConfigContentsGithubRelease) Lock added in v0.8.0

type ConfigContentsManual

type ConfigContentsManual struct{}

type ConfigContentsUnpackArchive added in v0.6.0

type ConfigContentsUnpackArchive struct {
	Path string `json:"path"`
}

type Directory

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

func NewDirectory

func NewDirectory(opts Config, ui ui.UI) *Directory

func (*Directory) Sync

func (d *Directory) Sync(syncOpts SyncOpts) (LockConfig, error)

type FileFilter added in v0.6.0

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

func (FileFilter) Apply added in v0.6.0

func (d FileFilter) Apply(dirPath string) error

type Git

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

func NewGit

func NewGit(opts ConfigContentsGit, infoLog io.Writer) *Git

func (*Git) Retrieve

func (t *Git) Retrieve(dstPath string) (GitInfo, error)

type GitInfo

type GitInfo struct {
	SHA         string
	CommitTitle string
}

type GitSync added in v0.6.0

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

func (GitSync) Sync added in v0.6.0

func (d GitSync) Sync(dstPath string) (LockConfigContentsGit, error)

type GithubReleaseAPI added in v0.6.0

type GithubReleaseAPI struct {
	URL    string `json:"url"`
	Body   string
	Assets []GithubReleaseAssetAPI
}

func (GithubReleaseAPI) AssetNames added in v0.6.0

func (a GithubReleaseAPI) AssetNames() []string

type GithubReleaseAssetAPI added in v0.6.0

type GithubReleaseAssetAPI struct {
	URL  string
	Name string
	Size int64
}

type GithubReleaseSync added in v0.6.0

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

func (GithubReleaseSync) DescAndURL added in v0.8.0

func (d GithubReleaseSync) DescAndURL() (string, string, error)

func (GithubReleaseSync) Sync added in v0.6.0

type InfoLog added in v0.3.0

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

func NewInfoLog added in v0.3.0

func NewInfoLog(ui ui.UI) *InfoLog

func (*InfoLog) Write added in v0.3.0

func (l *InfoLog) Write(data []byte) (int, error)

type LockConfig

type LockConfig struct {
	Path     string               `json:"path"`
	Contents []LockConfigContents `json:"contents"`
}

type LockConfigContents

type LockConfigContents struct {
	Path          string                           `json:"path"`
	Git           *LockConfigContentsGit           `json:"git,omitempty"`
	GithubRelease *LockConfigContentsGithubRelease `json:"githubRelease,omitempty"`
	Manual        *LockConfigContentsManual        `json:"manual,omitempty"`
	Directory     *LockConfigContentsDirectory     `json:"directory,omitempty"`
}

type LockConfigContentsDirectory added in v0.5.0

type LockConfigContentsDirectory struct{}

type LockConfigContentsGit

type LockConfigContentsGit struct {
	SHA         string `json:"sha"`
	CommitTitle string `json:"commitTitle"`
}

type LockConfigContentsGithubRelease added in v0.6.0

type LockConfigContentsGithubRelease struct {
	URL string `json:"url"`
}

type LockConfigContentsManual

type LockConfigContentsManual struct{}

type ReleaseNotesChecksums added in v0.6.0

type ReleaseNotesChecksums struct{}

func (ReleaseNotesChecksums) Find added in v0.6.0

func (ReleaseNotesChecksums) Find(files []string, body string) (map[string]string, error)

type SyncOpts added in v0.8.0

type SyncOpts struct {
	GithubAPIToken string
}

Jump to

Keyboard shortcuts

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