client

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseAuthorizationURL = "https://afosto.app/auth/authorize"
	BaseApiUrl           = "https://afosto.app/api"
	OauthClientID        = "51403354ded11942d7195c66b9e81f71b74f56cd8adc539277823e179da8"
	RedirectURL          = "http://localhost:8888/return"
)

Variables

This section is empty.

Functions

func GetAuthorizationURL

func GetAuthorizationURL(scopes []string) string

Types

type AfostoClient

type AfostoClient struct {
	// contains filtered or unexported fields
}

func GetClient

func GetClient(tenantID string, accessToken string) *AfostoClient

func (*AfostoClient) Download added in v0.0.17

func (ac *AfostoClient) Download(url *url.URL) ([]byte, error)

func (*AfostoClient) GetSignature added in v0.0.17

func (ac *AfostoClient) GetSignature(dir string, method string, asPrivateDirectory bool) (string, error)

func (*AfostoClient) GetTenant

func (ac *AfostoClient) GetTenant() (*data.Tenant, error)

func (*AfostoClient) ListDirectories added in v0.0.18

func (ac *AfostoClient) ListDirectories(dir string) ([]string, error)

func (*AfostoClient) ListDirectory added in v0.0.17

func (ac *AfostoClient) ListDirectory(dir string, cursor string) ([]data.File, string, error)

func (*AfostoClient) Query

func (ac *AfostoClient) Query(query string, parameters interface{}) (*QueryResult, error)

func (*AfostoClient) Upload added in v0.0.17

func (ac *AfostoClient) Upload(sourceFilePath string, labelFilename string, signature string) (*data.File, error)

type Query

type Query struct {
	OperationName *string     `json:"operationName"`
	Query         string      `json:"query"`
	Variables     interface{} `json:"variables"`
}

type QueryError

type QueryError struct {
	Message string   `json:"message"`
	Path    []string `json:"path"`
}

type QueryResult

type QueryResult struct {
	Data   map[string]interface{} `json:"data"`
	Errors []QueryError           `json:"errors"`
}

type SignatureRequest added in v0.0.21

type SignatureRequest struct {
	IsPublic bool              `json:"is_public"`
	Path     string            `json:"path"`
	IsListed bool              `json:"is_listed"`
	Method   string            `json:"method"`
	Metadata map[string]string `json:"metadata"`
}

Jump to

Keyboard shortcuts

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