girder

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx *Context, url string, success interface{}, failure interface{}) (*http.Response, error)

Get does stuff

func GetBasicAuth

func GetBasicAuth(ctx *Context, auth string, url string, success interface{}, failure interface{}) (*http.Response, error)

GetBasicAuth does stuff

func GetDownload

func GetDownload(ctx *Context, url string, file *os.File) (*http.Response, error)

func GetValidURL

func GetValidURL(maybeInvalidURL string) (string, error)

func Post

func Post(ctx *Context, url string, rawBody interface{}, success interface{}, failure *GirderError) (*http.Response, error)

Post does stuff

func Put

func Put(ctx *Context, url string, rawBody interface{}, success interface{}, failure interface{}) (*http.Response, error)

Put does stuff

Types

type Context

type Context struct {
	Auth        string
	URL         string
	Logger      *logrus.Logger
	Destination string
	ResourceMap ResourceMap
}

Context stores the entire context needed to run a sync command

func (*Context) CheckMinimumVersion

func (c *Context) CheckMinimumVersion() error

func (*Context) ValidateAuth

func (c *Context) ValidateAuth() error

type FailureSummary

type FailureSummary map[string]string

type GirderError

type GirderError struct {
	Message string `json:"message"`
}

func (*GirderError) Error

func (error *GirderError) Error() string

type GirderFile

type GirderFile struct {
	ID   GirderID `json:"_id"`
	Size int64    `json:"size"`
}

func ItemFiles

func ItemFiles(ctx *Context, itemID GirderID) []GirderFile

type GirderID

type GirderID string

func GetOrCreateFolderRecursive

func GetOrCreateFolderRecursive(ctx *Context, path string) (GirderID, error)

func GetOrCreateItem

func GetOrCreateItem(ctx *Context, folderID GirderID, name string) (GirderID, error)

type GirderObject

type GirderObject struct {
	ID   GirderID `json:"_id"`
	Name string   `json:"name"`
}

func Folders

func Folders(ctx *Context, folderID GirderID) []GirderObject

func Items

func Items(ctx *Context, folderID GirderID) []GirderObject

type GirderRelease

type GirderRelease struct {
	Release    string `json:"release"`
	APIVersion string `json:"apiVersion"`
}

type GirderTokenResponse

type GirderTokenResponse struct {
	AuthToken struct {
		Token string `json:"token"`
	} `json:"authToken"`
	User struct {
		ID    string `json:"_id"`
		Email string `json:"email"`
	} `json:"user"`
}

type GirderUser

type GirderUser struct {
	Email string `json:"email"`
}

type ItemMap

type ItemMap struct {
	sync.Mutex
	M map[string]GirderID
}

type PathAndResource

type PathAndResource struct {
	Path     string
	Resource *Resource
}

type Resource

type Resource struct {
	Path string
	Size int64
	Type string

	GirderID   GirderID
	GirderType string

	SkipSync   bool
	SkipReason string
}

Resource represents a local path and the relationship to a Girder resource

type ResourceMap

type ResourceMap map[string]*Resource

ResourceMap maps on-disk paths to "resources"

func (ResourceMap) Parent

func (m ResourceMap) Parent(resource *Resource) *Resource

Jump to

Keyboard shortcuts

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