directory

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 Config

type Config struct {
	Path     string
	Contents []ConfigContents
}

type ConfigContents

type ConfigContents struct {
	Path string

	Git       *ConfigContentsGit
	Manual    *ConfigContentsManual
	Directory *ConfigContentsDirectory

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

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

func (ConfigContents) LegalPathsWithDefaults

func (c ConfigContents) LegalPathsWithDefaults() []string

type ConfigContentsDirectory

type ConfigContentsDirectory struct {
	Path string
}

type ConfigContentsGit

type ConfigContentsGit struct {
	URL string
	Ref string
}

type ConfigContentsManual

type ConfigContentsManual struct{}

type Directory

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

func NewDirectory

func NewDirectory(opts Config) *Directory

func (*Directory) Sync

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

type Git

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

func NewGit

func NewGit(opts ConfigContentsGit) *Git

func (*Git) Retrieve

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

type GitInfo

type GitInfo struct {
	SHA         string
	CommitTitle string
}

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"`
	Manual *LockConfigContentsManual `json:"manual,omitempty"`
}

type LockConfigContentsGit

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

type LockConfigContentsManual

type LockConfigContentsManual struct{}

Jump to

Keyboard shortcuts

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