globus

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Verbose int

Verbose shows verbose output for this module

Functions

func ChessGlobusLink(collection, path string) (string, error)

ChessGlobusLink provides globus link to given globus collection name and path

func Download

func Download(token string, endpointID string, remotePath string) ([]byte, error)

Download API

func GlobusLink(cid, path string) (string, error)

generate Globus collection URL link

func Ls

func Ls(token, endpointID, path string)

Ls API provides listing files within Globus

func Mkdir

func Mkdir(token, endpointID, path string) error

Mkdir provides API to create Globus directory

func SharedLink(token, endpointID, path string) (string, error)

SharedLink provides shared link to Globus data

func Token

func Token(scopes []string) (string, error)

Token API obtains Globus access token example through curl curl -X POST https://auth.globus.org/v2/oauth2/token --header "Content-Type: application/x-www-form-urlencoded" --data-urlencode "grant_type=client_credentials" --data-urlencode "scope=$scope" --data-urlencode "client_id=$clientid" --data-urlencode "client_secret=$secret"

func Upload

func Upload(token, endpointID, localFile, remotePath string) error

Upload API

Types

type GlobusEndpointResponse

type GlobusEndpointResponse struct {
	// Define the structure based on the response from the API
	Endpoints []struct {
		ID          string `json:"id"`
		DisplayName string `json:"display_name"`
		Owner       string `json:"owner_string"`
		Description string `json:"description"`
	} `json:"DATA"`
}

GlobusEndpointResponse represents globus endpoint response

type GlobusFileListResponse

type GlobusFileListResponse struct {
	// Define the structure based on the response from the API
	Files []struct {
		Name string `json:"name"`
		Type string `json:"type"`
	} `json:"DATA"`
}

GlobusFileListResponse represents globus file list response

type GlobusSearchResponse

type GlobusSearchResponse struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Owner       string `json:"owner_string"`
	Description string `json:"description"`
}

GlobusSearchResponse represents globus search response

func Search(token string, pattern string) []GlobusSearchResponse

Search API provides search API to globus search pattern example of curl curl -H "Accept: application/json" -H "Authorization: Bearer $t" "https://transfer.api.globus.org/v0.10/endpoint_search?filter_fulltext=CHESS"

type GlobusTokenResponse

type GlobusTokenResponse struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	TokenType   string `json:"token_type"`
}

GlobusTokenResponse represents globus token response

Jump to

Keyboard shortcuts

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