Documentation ¶
Index ¶
- Variables
- func CalculateFileDigest(raw []byte) (string, []byte, error)
- func List(rSpec model.RepoSpec, search *model.SearchParams) (model.SearchResult, error, []*repos.RepoAccessError)
- type DeleteCommand
- type FetchCommand
- func (c *FetchCommand) FetchByName(spec model.RepoSpec, fn FetchName, restoreId bool) (string, []byte, error, []*repos.RepoAccessError)
- func (c *FetchCommand) FetchByTMID(spec model.RepoSpec, tmid string, restoreId bool) (string, []byte, error, []*repos.RepoAccessError)
- func (c *FetchCommand) FetchByTMIDOrName(spec model.RepoSpec, idOrName string, restoreId bool) (string, []byte, error, []*repos.RepoAccessError)
- type FetchName
- type Now
- type PushCommand
- type VersionsCommand
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidFetchName = errors.New("invalid fetch name")
Functions ¶
func CalculateFileDigest ¶
CalculateFileDigest calculates the hash string for TM version. Returns the 12-char hash string, the file contents that were hashed, and an error. The contents that were hashed may differ from the input. The changes to the contents are made to make the hashing reliable and idempotent: normalizing line endings, and setting 'id' to empty string If the file is not a valid json, the function is not guaranteed to return with an error
func List ¶
func List(rSpec model.RepoSpec, search *model.SearchParams) (model.SearchResult, error, []*repos.RepoAccessError)
Types ¶
type DeleteCommand ¶
type DeleteCommand struct { }
func NewDeleteCommand ¶
func NewDeleteCommand() *DeleteCommand
type FetchCommand ¶
type FetchCommand struct { }
func NewFetchCommand ¶
func NewFetchCommand() *FetchCommand
func (*FetchCommand) FetchByName ¶
func (c *FetchCommand) FetchByName(spec model.RepoSpec, fn FetchName, restoreId bool) (string, []byte, error, []*repos.RepoAccessError)
func (*FetchCommand) FetchByTMID ¶
func (c *FetchCommand) FetchByTMID(spec model.RepoSpec, tmid string, restoreId bool) (string, []byte, error, []*repos.RepoAccessError)
func (*FetchCommand) FetchByTMIDOrName ¶
func (c *FetchCommand) FetchByTMIDOrName(spec model.RepoSpec, idOrName string, restoreId bool) (string, []byte, error, []*repos.RepoAccessError)
type FetchName ¶
func ParseAsTMIDOrFetchName ¶
ParseAsTMIDOrFetchName parses idOrName as model.TMID. If that fails, parses it as FetchName. Returns error is idOrName is not valid as either. Only one of returned pointers may be not nil
func ParseFetchName ¶
type PushCommand ¶
type PushCommand struct {
// contains filtered or unexported fields
}
func NewPushCommand ¶
func NewPushCommand(now Now) *PushCommand
func (*PushCommand) PushFile ¶
PushFile prepares file contents for pushing (generates id if necessary, etc.) and pushes to repo. Returns the ID that the TM has been stored under, and error. If the repo already contains the same TM, returns the id of the existing TM and an instance of repos.ErrTMIDConflict
type VersionsCommand ¶
type VersionsCommand struct { }
func NewVersionsCommand ¶
func NewVersionsCommand() *VersionsCommand
func (*VersionsCommand) ListVersions ¶
func (c *VersionsCommand) ListVersions(spec model.RepoSpec, name string) ([]model.FoundVersion, error, []*repos.RepoAccessError)