Documentation ¶
Index ¶
- Constants
- Variables
- func CleanRemote(name string) (string, error)
- func Download(ctx context.Context, f func(int64) io.WriteCloser, url string) error
- func FindRemote(name string, options SuggestOptions) (string, string, error)
- func IsUid(path string) bool
- func MacCpuString(cpu macho.Cpu) string
- func SuggestGitName(name string) (string, error)
- func SuggestRemote(name string, options SuggestOptions) (string, string, error)
- func ToArchArray(archs []Arch) []string
- func Upload(ctx context.Context, r io.ReadCloser, size int64, url string) error
- type Arch
- type Client
- func (c *Client) Delete(ctx context.Context, request *astore.DeleteRequest)
- func (c *Client) Download(files []FileToDownload, o DownloadOptions) ([]*apb.Artifact, error)
- func (c *Client) GetRetrieveResponse(name string, archs []string, defaultId PathType, tags *[]string) (*apb.RetrieveResponse, *apb.RetrieveRequest, PathType, error)
- func (c *Client) List(path string, o ListOptions) ([]*apb.Artifact, []*apb.Element, error)
- func (c *Client) Note(uid string, note string) ([]*astore.Artifact, error)
- func (c *Client) Publish(el ToPublish) (string, *astore.ListResponse, error)
- func (c *Client) Tag(uid string, mods ...TagModifier) ([]*astore.Artifact, error)
- func (c *Client) Unpublish(el string) error
- func (c *Client) Upload(files []FileToUpload, o UploadOptions) ([]*apb.Artifact, error)
- type DownloadOptions
- type FileToDownload
- type FileToUpload
- type Formatter
- type ListOptions
- type PathType
- type SuggestOptions
- type TagModifier
- type ToPublish
- type UglyFormatter
- type UploadOptions
Constants ¶
View Source
const ( IdAuto PathType = "" IdPath = "path" IdUid = "uid" )
Variables ¶
View Source
var UidRegex = regexp.MustCompile("^[a-z0-9]{32}$")
Functions ¶
func CleanRemote ¶
func FindRemote ¶
func FindRemote(name string, options SuggestOptions) (string, string, error)
func MacCpuString ¶
func SuggestGitName ¶
func SuggestRemote ¶
func SuggestRemote(name string, options SuggestOptions) (string, string, error)
func ToArchArray ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(conn grpc.ClientConnInterface) *Client
func (*Client) Download ¶
func (c *Client) Download(files []FileToDownload, o DownloadOptions) ([]*apb.Artifact, error)
func (*Client) GetRetrieveResponse ¶
func (c *Client) GetRetrieveResponse(name string, archs []string, defaultId PathType, tags *[]string) (*apb.RetrieveResponse, *apb.RetrieveRequest, PathType, error)
GetRetrieveResponse performs a Retrieve request, and returns both the generated request, and returned response.
func (*Client) Upload ¶
func (c *Client) Upload(files []FileToUpload, o UploadOptions) ([]*apb.Artifact, error)
type DownloadOptions ¶
type FileToDownload ¶
type FileToDownload struct { // Name of the file on the remote system. Remote string // ok RemoteType PathType // ok // How we want the file to be named on the local filesystem. Local string // Overwrite the file if there already? Overwrite bool // First architecture found is downloaded. Architecture []string // ok // No tags means latest tag. Tag *[]string }
type FileToUpload ¶
type FileToUpload struct { // Which file needs to be open on the local file system. Local string // How we want the file named on the remote file system. Remote string // If this file is geared toward a specific architecture. Architecture []string // User assigned note, nothing to see here, just a string. Note string // List of tags to apply to the file. Tag []string }
type ListOptions ¶
type PathType ¶
type PathType string
func GetPathType ¶
func RetrieveRequestFromPath ¶
func RetrieveRequestFromPath(name string, id PathType) (*apb.RetrieveRequest, PathType)
type SuggestOptions ¶
type SuggestOptions struct { // If Directory is set, the returned remote location will use the set directory + the name of the file. Directory string File string // Files specified to upload can be in the form /path/to/local@/path/to/remote/, which takes precedence // over any other recommendation mechanism. // // If DisableAt is set to true, this manual override is disabled. DisableAt bool // If DisableGit is set to true, git will not be used to suggest a remote file name. DisableGit bool // Allow absolute paths. AllowAbsolute bool // Allow a file name without directory. AllowSingleElement bool }
type TagModifier ¶
type TagModifier func(*astore.TagRequest)
func TagAdd ¶
func TagAdd(set []string) TagModifier
func TagDel ¶
func TagDel(set []string) TagModifier
func TagSet ¶
func TagSet(set []string) TagModifier
type UglyFormatter ¶
func NewUgly ¶
func NewUgly() *UglyFormatter
func (*UglyFormatter) Artifact ¶
func (uf *UglyFormatter) Artifact(art *astore.Artifact)
func (*UglyFormatter) Element ¶
func (uf *UglyFormatter) Element(el *astore.Element)
func (*UglyFormatter) File ¶
func (uf *UglyFormatter) File() *os.File
func (*UglyFormatter) Flush ¶
func (uf *UglyFormatter) Flush()
type UploadOptions ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.