api_client

package
v0.0.0-...-5d4f8f2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RepoUriPath        = "repo"
	RepoAttrsUriPath   = "repo_attrs"
	BranchAttrsUriPath = "branch_attr"
	CommitUriPath      = "commit"
	CloseCommitUriPath = "commit_close"
	CommitAttrsUriPath = "commit_attrs"

	CommitMapUriPath    = "commit_map"
	FileUriPath         = "file"
	FileAttrsUriPath    = "file_attrs"
	ObjectUriPath       = "object"
	VfsUriPath          = "vfs"
	WorkerUriPath       = "worker"
	FlowUriPath         = "flow"
	FlowAttrsUriPath    = "flow"
	TaskAttrsUriPath    = "tasks"
	TasksUriPath        = "tasks"
	TaskStatusUriPath   = "task_status"
	CommandLogUriPath   = "/{task_id}/cmd_log"
	ModelUriPath        = "/{task_id}/model"
	CommitFileURL       = "file_url"
	CommitFileCheckIn   = "/file_checkin"
	CommitFilePartURL   = "parts_url"
	CommitFilePartMerge = "parts_merge"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FsConfig

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

type ServerConfig

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

type WorkerClient

type WorkerClient struct {
	BaseURL   *url.URL
	Config    *config.Config
	AuthToken string

	// Rest Client to fetch info from server
	RepoAttrs rest_client.Interface

	// Rest client for commit info
	CommitAttrs rest_client.Interface

	// Rest client for commit map
	CommitMap rest_client.Interface

	// Rest client for branch info
	BranchAttrs rest_client.Interface

	// File Info client
	FileAttrs rest_client.Interface

	// object client
	ContentIo rest_client.Interface

	// flow attributes
	FlowAttrs rest_client.Interface

	TaskAttrs rest_client.Interface

	TaskStatus rest_client.Interface

	WorkerAttrs rest_client.Interface
	// contains filtered or unexported fields
}

func NewWorkerClient

func NewWorkerClient(serverAddr string) (*WorkerClient, error)

func (*WorkerClient) CloseCommit

func (wc *WorkerClient) CloseCommit(repoName, branchName, commitId string) error

func (*WorkerClient) DetachWorker

func (wc *WorkerClient) DetachWorker(flowId string, taskId string, workerId string) error

func (*WorkerClient) FetchBranchAttrs

func (wc *WorkerClient) FetchBranchAttrs(repoName, branchName string) (*ws.BranchAttrs, error)

func (*WorkerClient) FetchCommitAttrs

func (wc *WorkerClient) FetchCommitAttrs(repoName, commitId string) (*ws.CommitAttrs, error)

func (*WorkerClient) FetchCommitMap

func (wc *WorkerClient) FetchCommitMap(repoName, commitId string) (*ws.FileMap, error)

func (*WorkerClient) FetchFileAttrs

func (wc *WorkerClient) FetchFileAttrs(repoName string, commitId string, fpath string) (*ws.FileAttrs, error)

func (*WorkerClient) FetchFlowAttrs

func (wc *WorkerClient) FetchFlowAttrs(flowId string) (*flw.FlowAttrs, error)

func (*WorkerClient) FileCheckIn

func (wc *WorkerClient) FileCheckIn(repoId, branchName, commitId, filepath string, size int64) (*ws.FileAttrs, error)

Method requests server to check object size and update in file metadata

func (*WorkerClient) GetFileObject

func (wc *WorkerClient) GetFileObject(repoName string, commitId string, fpath string, offset int64, size int64, writebuf io.Writer) error

func (*WorkerClient) GetOrCreateFlowOutRepo

func (wc *WorkerClient) GetOrCreateFlowOutRepo(flowId string) (*ws.Repo, *ws.Branch, *ws.Commit, error)

func (*WorkerClient) GetOrCreateModelRepo

func (wc *WorkerClient) GetOrCreateModelRepo(flowId string) (*ws.Repo, *ws.Branch, *ws.Commit, error)

func (*WorkerClient) ListDir

func (wc *WorkerClient) ListDir(reponame string, commitId string, path string) (map[string]*ws.FileAttrs, error)

func (*WorkerClient) LookupFile

func (wc *WorkerClient) LookupFile(reponame string, commitId string, p string) (*ws.FileAttrs, error)

func (*WorkerClient) MergePartsNCheckIn

func (wc *WorkerClient) MergePartsNCheckIn(parts []int, repoId, branchName, commitId, filepath string, size int64) (*ws.FileAttrs, error)

Method sends part for merging and checking in final object

func (*WorkerClient) PostLogWriter

func (wc *WorkerClient) PostLogWriter(taskId string) (io.WriteCloser, error)

func (*WorkerClient) PutFileWriter

func (wc *WorkerClient) PutFileWriter(repoName string, commitId string, fpath string) (io.WriteCloser, error)

func (*WorkerClient) ReceiveBytesFromURL

func (wc *WorkerClient) ReceiveBytesFromURL(surl string) (data []byte, rcvd int64, fnerr error)

func (*WorkerClient) RegisterWorker

func (wc *WorkerClient) RegisterWorker(flowId string, taskId string, ip string) (*flw.WorkerAttrs, error)

func (*WorkerClient) SendBytesToURL

func (wc *WorkerClient) SendBytesToURL(surl string, data []byte) (sent int64, fnerr error)

Method sends data to cloud storage server through signed url

func (*WorkerClient) SignedGetPartURL

func (wc *WorkerClient) SignedGetPartURL(seq int, repoId, branchName, commitId, filepath string) (string, error)

func (*WorkerClient) SignedGetURL

func (wc *WorkerClient) SignedGetURL(repoId, branchName, commitId, filepath string) (string, error)

func (*WorkerClient) SignedPutPartURL

func (wc *WorkerClient) SignedPutPartURL(seq int, repoId, branchName, commitId, filepath string) (string, error)

func (*WorkerClient) SignedPutURL

func (wc *WorkerClient) SignedPutURL(repoId, branchName, commitId, filepath string) (string, error)

func (*WorkerClient) UpdateTaskStatus

func (w *WorkerClient) UpdateTaskStatus(workerId string, taskId string, tsr *flw.TaskStatusChangeRequest) (*flw.TaskStatusChangeResponse, error)

Jump to

Keyboard shortcuts

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