blend4go

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 11 Imported by: 0

README

blend4go

PkgGoDev
Galaxy API client library for Golang

See the documentation for more information.

Contributing

PRs are welcome, please conform to all Golang format and design recommendations.

A number of subpackages are unimplemented. They will be implemented as interest in this project grows. Currently, this project only exists to serve the requirements of the Galaxy Terraform Provider.

Documentation

Overview

blend4go Galaxy API client library for Golang

For most use cases, NewGalaxyInstance and GetAPIKey are the only functions in the root package that should be used. Subpackages provide their own implementations of the remaining functions and those should be preferred. Subpackages are organised by subject. See workflows, users, tools, roles, repositories, libraries, jobs, histories, groups, or datatypes subpackages for more information.

A number of subpackages are currently unimplemented, they will be implemented with interest in this project or as needed

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAPIKey added in v0.1.3

func GetAPIKey(ctx context.Context, host, username, password string) (string, error)

returns an API key for authenticated user based on BaseAuth headers Username is the users email address until https://github.com/galaxyproject/galaxy/pull/10521

func HandleResponse added in v0.1.12

func HandleResponse(response *resty.Response) (interface{}, error)

Handle responses from Galaxy API, checking for errors

Types

type ErrorResponse added in v0.1.12

type ErrorResponse struct {
	URL      string
	Method   string
	Message1 string `json:"message"`
	Code1    string `json:"code"`
	Message  string `json:"err_msg"`
	Code     int    `json:"err_code"`
}

func (*ErrorResponse) Error added in v0.2.1

func (e *ErrorResponse) Error() string

func (*ErrorResponse) String added in v0.1.12

func (e *ErrorResponse) String() string

type GalaxyInstance

type GalaxyInstance struct {
	Client *resty.Client
	// contains filtered or unexported fields
}

func NewGalaxyInstance

func NewGalaxyInstance(host, apiKey string) (g *GalaxyInstance)

func NewGalaxyInstanceLogger added in v0.2.2

func NewGalaxyInstanceLogger(host, apiKey string, logWriter io.Writer, logLevel LogLevel) (g *GalaxyInstance)

Create a new connection handle to an instance of Galaxy

func (*GalaxyInstance) Debug added in v0.2.2

func (g *GalaxyInstance) Debug(v ...interface{})

func (*GalaxyInstance) Debugf added in v0.2.2

func (g *GalaxyInstance) Debugf(format string, v ...interface{})

func (*GalaxyInstance) Delete

func (g *GalaxyInstance) Delete(ctx context.Context, model GalaxyModel, params *map[string]string) error

Helper to make generic DELETE requests to delete single objects params is a map of query parameters to add to the request

func (*GalaxyInstance) Error added in v0.2.2

func (g *GalaxyInstance) Error(v ...interface{})

func (*GalaxyInstance) Errorf added in v0.2.2

func (g *GalaxyInstance) Errorf(format string, v ...interface{})

func (*GalaxyInstance) Get

func (g *GalaxyInstance) Get(ctx context.Context, id GalaxyID, model GalaxyModel, params *map[string]string) (GalaxyModel, error)

Helper to make generic requests against Galaxy API that returns single object params is a map of query parameters to add to the request

func (*GalaxyInstance) HandleResponse added in v0.2.2

func (g *GalaxyInstance) HandleResponse(response *resty.Response) (interface{}, error)

func (*GalaxyInstance) Info added in v0.2.2

func (g *GalaxyInstance) Info(v ...interface{})

func (*GalaxyInstance) Infof added in v0.2.2

func (g *GalaxyInstance) Infof(format string, v ...interface{})

func (*GalaxyInstance) List

func (g *GalaxyInstance) List(ctx context.Context, path string, models interface{}, params *map[string]string) (interface{}, error)

Helper to make generic requests against Galaxy API that return lists of objects params is a map of query parameters to add to the request

func (*GalaxyInstance) Patch added in v0.2.2

func (g *GalaxyInstance) Patch(ctx context.Context, model GalaxyModel, params *map[string]string) (GalaxyModel, error)

Helper to make generic PATCH requests to Galaxy API to update objects params is a map of query parameters to add to the request

func (*GalaxyInstance) Put

func (g *GalaxyInstance) Put(ctx context.Context, model GalaxyModel, params *map[string]string) (GalaxyModel, error)

Helper to make generic PUT requests to Galaxy API to update objects params is a map of query parameters to add to the request

func (*GalaxyInstance) R

Helper to create a new request to the Galaxy API Use this if one of the other functions in this package are not appropriate for the request

func (*GalaxyInstance) ToolSheds

func (g *GalaxyInstance) ToolSheds(ctx context.Context) ([]*ToolShed, error)

Get a list of toolsheds configured in the galaxy instance

func (*GalaxyInstance) Version added in v0.2.2

func (g *GalaxyInstance) Version(ctx context.Context) (string, error)

Return a description of the major version of Galaxy (e.g. 15.03).

type GalaxyModel

type GalaxyModel interface {
	GetBasePath() string
	SetGalaxyInstance(*GalaxyInstance)
	GetID() GalaxyID
	SetID(GalaxyID)
}

type GalaxyRequest

type GalaxyRequest = *resty.Request

type LogLevel added in v0.2.2

type LogLevel int
const (
	NONE LogLevel = iota
	ERROR
	WARN
	INFO
	DEBUG
)

type StatusResponse

type StatusResponse struct {
	Status  string `json:"status"`
	Message string `json:"message"`
}

type ToolShed

type ToolShed struct {
	Name string `json:"name"`
	Url  string `json:"url"`
}

Directories

Path Synopsis
datatypes models represent and manipulate datatypes within a Galaxy instance Relevant api endpoints are: `/api/datatypes`
datatypes models represent and manipulate datatypes within a Galaxy instance Relevant api endpoints are: `/api/datatypes`
groups models represent and manipulate groups within a Galaxy instance Relevant api endpoints are: `/api/groups`
groups models represent and manipulate groups within a Galaxy instance Relevant api endpoints are: `/api/groups`
histories models represent and manipulate histories and their contents within a Galaxy instance Relevant api endpoints are: `/api/histories`, `/api/histories/{id}/contents/`
histories models represent and manipulate histories and their contents within a Galaxy instance Relevant api endpoints are: `/api/histories`, `/api/histories/{id}/contents/`
jobs models represent and manipulate jobs within a Galaxy instance Relevant api endpoints are: `/api/jobs`, `/api/job_lock`
jobs models represent and manipulate jobs within a Galaxy instance Relevant api endpoints are: `/api/jobs`, `/api/job_lock`
libraries models represent and manipulate libraries within a Galaxy instance Relevant api endpoints are: `/api/libraries`
libraries models represent and manipulate libraries within a Galaxy instance Relevant api endpoints are: `/api/libraries`
quotas models represent and manipulate quotas within a Galaxy instance Relevant api endpoints are: `/api/quotas`
quotas models represent and manipulate quotas within a Galaxy instance Relevant api endpoints are: `/api/quotas`
repositories models represent and manipulate repositories within a Galaxy instance Relevant api endpoints are: `/api/tool_shed_repositories`
repositories models represent and manipulate repositories within a Galaxy instance Relevant api endpoints are: `/api/tool_shed_repositories`
roles models represent and manipulate roles within a Galaxy instance Relevant api endpoints are: `/api/roles`
roles models represent and manipulate roles within a Galaxy instance Relevant api endpoints are: `/api/roles`
tools models represent and manipulate tools within a Galaxy instance Relevant api endpoints are: `/api/tools`
tools models represent and manipulate tools within a Galaxy instance Relevant api endpoints are: `/api/tools`
users models represent and manipulate users within a Galaxy instance Relevant api endpoints are: `/api/users`
users models represent and manipulate users within a Galaxy instance Relevant api endpoints are: `/api/users`
workflows models represent and manipulate workflows within a Galaxy instance Relevant api endpoints are: `/api/workflows`, `/api/invocations`
workflows models represent and manipulate workflows within a Galaxy instance Relevant api endpoints are: `/api/workflows`, `/api/invocations`

Jump to

Keyboard shortcuts

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