packager

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0, MIT, MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeNoCompress = 0
	TypeGZ         = 01
	TypeZST        = 02
	TypeRaw        = 020
	TypeEncryption = 030
)

Variables

This section is empty.

Functions

func GenerateD1agHeader

func GenerateD1agHeader(meta map[string]interface{}, compress byte, cert *x509.Certificate) ([]byte, error)

meta not compress

func PackageCollectedData

func PackageCollectedData(pOpt *PackageOptions, skipConfirm bool) (string, error)

func ParserD1agHeader

func ParserD1agHeader(r io.Reader) (meta []byte, format, compress string, offset int, err error)

func Upload

func Upload(ctx context.Context, opt *UploadOptions, skipConfirm bool) (string, error)

func UploadComplete

func UploadComplete(logger *logprinter.Logger, fileUUID string, opt *UploadOptions) (string, error)

func UploadFile

func UploadFile(
	logger *logprinter.Logger,
	concurrency int,
	presp *preCreateResponse,
	fileSize int64,
	flush FlushUploadFile,
	open OpenFunc,
	uploadPart UploadPart,
) (string, error)

Types

type ClientOptions

type ClientOptions struct {
	Endpoint string
	Token    string
	Client   *http.Client
}

type FlushResponse

type FlushResponse struct {
	ResultURL string `json:"result"`
}

type FlushUploadFile

type FlushUploadFile func() (string, error)

type Histroy

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

func LoadHistroy

func LoadHistroy() (*Histroy, error)

func (*Histroy) PrintList

func (h *Histroy) PrintList()

func (*Histroy) Push

func (h *Histroy) Push(url string)

func (*Histroy) Store

func (h *Histroy) Store() error

type OpenFunc

type OpenFunc func() (io.ReadSeekCloser, error)

type PackageOptions

type PackageOptions struct {
	InputDir   string // source directory of collected data
	OutputFile string // target file to store packaged data
	Cert       string // crt to encrypt data
	CertPath   string // crt file to encrypt data
	Rebuild    bool
	Meta       map[string]interface{}
}

type UploadOptions

type UploadOptions struct {
	FilePath    string
	Alias       string
	Issue       string
	Concurrency int
	Rebuild     bool
	Cert        string
	ClientOptions
}

type UploadPart

type UploadPart func(int64, int64, io.Reader) error

Jump to

Keyboard shortcuts

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