zboxutil

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: MIT Imports: 25 Imported by: 6

Documentation

Index

Constants

View Source
const (
	ALLOCATION_ENDPOINT      = "/allocation"
	UPLOAD_ENDPOINT          = "/v1/file/upload/"
	ATTRS_ENDPOINT           = "/v1/file/attributes/"
	RENAME_ENDPOINT          = "/v1/file/rename/"
	COPY_ENDPOINT            = "/v1/file/copy/"
	LIST_ENDPOINT            = "/v1/file/list/"
	REFERENCE_ENDPOINT       = "/v1/file/referencepath/"
	CONNECTION_ENDPOINT      = "/v1/connection/details/"
	COMMIT_ENDPOINT          = "/v1/connection/commit/"
	DOWNLOAD_ENDPOINT        = "/v1/file/download/"
	LATEST_READ_MARKER       = "/v1/readmarker/latest"
	FILE_META_ENDPOINT       = "/v1/file/meta/"
	FILE_STATS_ENDPOINT      = "/v1/file/stats/"
	OBJECT_TREE_ENDPOINT     = "/v1/file/objecttree/"
	COMMIT_META_TXN_ENDPOINT = "/v1/file/commitmetatxn/"
	CALCULATE_HASH_ENDPOINT  = "/v1/file/calculatehash/"
)
View Source
const EncryptedFolderName = "encrypted"
View Source
const MAX_RETRIES = 5
View Source
const REGISTER_CLIENT = "v1/client/put"
View Source
const SC_REST_API_URL = "v1/screst/"
View Source
const SLEEP_BETWEEN_RETRIES = 5

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(key, text []byte) ([]byte, error)

func Encrypt

func Encrypt(key, text []byte) ([]byte, error)

func GetFileContentType

func GetFileContentType(out *os.File) (string, error)

func GetFullRemotePath

func GetFullRemotePath(localPath, remotePath string) string

func HttpDo

func HttpDo(ctx context.Context, cncl context.CancelFunc, req *http.Request, f func(*http.Response, error) error) error

func IsRemoteAbs

func IsRemoteAbs(path string) bool

func Join

func Join(a, b string) string

func MakeSCRestAPICall

func MakeSCRestAPICall(scAddress string, relativePath string, params map[string]string, handler SCRestAPIHandler) ([]byte, error)

func NewAllocationRequest

func NewAllocationRequest(baseUrl, allocation string) (*http.Request, error)

func NewAttributesRequest

func NewAttributesRequest(baseUrl, allocation string, body io.Reader) (
	req *http.Request, err error)

func NewCalculateHashRequest

func NewCalculateHashRequest(baseUrl, allocation string, paths []string) (*http.Request, error)

func NewCommitMetaTxnRequest

func NewCommitMetaTxnRequest(baseUrl string, allocation string, body io.Reader) (*http.Request, error)

func NewCommitRequest

func NewCommitRequest(baseUrl, allocation string, body io.Reader) (*http.Request, error)

func NewConnectionId

func NewConnectionId() string

func NewCopyRequest

func NewCopyRequest(baseUrl, allocation string, body io.Reader) (*http.Request, error)

func NewDeleteRequest

func NewDeleteRequest(baseUrl, allocation string, body io.Reader) (*http.Request, error)

func NewDownloadRequest

func NewDownloadRequest(baseUrl, allocation string, body io.Reader) (*http.Request, error)

func NewFileMetaRequest

func NewFileMetaRequest(baseUrl string, allocation string, body io.Reader) (*http.Request, error)

func NewFileStatsRequest

func NewFileStatsRequest(baseUrl string, allocation string, body io.Reader) (*http.Request, error)

func NewHTTPRequest

func NewHTTPRequest(method string, url string, data []byte) (*http.Request, context.Context, context.CancelFunc, error)

func NewListRequest

func NewListRequest(baseUrl, allocation string, path string, auth_token string) (*http.Request, error)

func NewObjectTreeRequest

func NewObjectTreeRequest(baseUrl, allocation string, path string) (*http.Request, error)

func NewReferencePathRequest

func NewReferencePathRequest(baseUrl, allocation string, paths []string) (*http.Request, error)

func NewRenameRequest

func NewRenameRequest(baseUrl, allocation string, body io.Reader) (*http.Request, error)

func NewUploadRequest

func NewUploadRequest(baseUrl, allocation string, body io.Reader, update bool) (*http.Request, error)

func RemoteClean

func RemoteClean(path string) string

Types

type SCRestAPIHandler

type SCRestAPIHandler func(response map[string][]byte, numSharders int, err error)

Jump to

Keyboard shortcuts

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