cmd

package
v0.0.0-...-75f766f Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: GPL-3.0 Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const ChunkSize int = 800 * 1024 //0.8MB

Variables

This section is empty.

Functions

func CheckLockError

func CheckLockError(err error)

reutrn EBUSY if LOCK is exist

func Download

func Download(destdir, apiPrefix, groupid, trxid string) error

func Execute

func Execute()

func FileToSegments

func FileToSegments(filename string, fileinfo *Fileinfo, tmpdir string) error

func HttpCheckTrxId

func HttpCheckTrxId(apiPrefix string, groupid string, trxid string) (bool, error)

func HttpGetFileFromGroup

func HttpGetFileFromGroup(apiPrefix string, groupid string, trxid string) (*quorumpb.Object, string, error)

func HttpGetFromContentApi

func HttpGetFromContentApi(apiPrefix string, groupid string, trxid string, num int, includetrx bool) ([]byte, error)

func HttpGetNextFileFromGroupByTrx

func HttpGetNextFileFromGroupByTrx(apiPrefix string, groupid string, trxid string) (*quorumpb.Object, string, error)

func InitDefaultKeystore

func InitDefaultKeystore(config InitKeystoreParam, nodeoptions *options.NodeOptions) (localcrypto.Keystore, *ethkeystore.Key, error)

func InitRelayNodeKeystore

func InitRelayNodeKeystore(config cli.RelayNodeFlag, defaultKeyName string, relayNodeOpt *options.RelayNodeOptions) (localcrypto.Keystore, *ethkeystore.Key, error)

func OpenFileInZip

func OpenFileInZip(zipfile *zip.ReadCloser, name string) (io.ReadCloser, error)

func ParseFileSegment

func ParseFileSegment(fileobj *quorumpb.Object) ([]byte, error)

func PostFileToGroupApi

func PostFileToGroupApi(apiPrefix, groupid string, post *quorumpb.Activity) (string, error)

func ReadFileInZip

func ReadFileInZip(zipfile *zip.ReadCloser, filename string) (string, error)

func Split

func Split(filename, tmpdir string) error

func Upload

func Upload(segmentsdir, groupid, apiPrefix string) error

func WriteFileinfo

func WriteFileinfo(segmentpath string, fileinfo *Fileinfo)

func WriteToFile

func WriteToFile(tmpdir string, filename string, data []byte) error

Types

type Container

type Container struct {
	Rootfile Rootfile `xml:"rootfiles>rootfile"`
}

type Contentfile

type Contentfile struct {
	Metadata Metadata `xml:"metadata"`
}

type FileItem

type FileItem struct {
	Compression string `json:"compression"`
	MediaType   string `json:"mediaType"`
	Content     string `json:"content"`
}

type Fileinfo

type Fileinfo struct {
	MediaType string         `json:"mediaType"`
	Name      string         `json:"name"`
	Title     string         `json:"title"`
	Sha256    string         `json:"sha256"`
	Segments  *[]Segmentinfo `json:"segments"`
}

func OpenEpub

func OpenEpub(filename string) (*Fileinfo, error)

func ParseFileinfo

func ParseFileinfo(fileinfocontent *quorumpb.File) (*Fileinfo, error)

func VerifyFileFormat

func VerifyFileFormat(filename string) (*Fileinfo, error)

func VerifySegments

func VerifySegments(segmentpath string) (*Fileinfo, error)

type GroupContentObjectItem

type GroupContentObjectItem struct {
	TrxId     string
	Publisher string
	Content   quorumpb.Object
	TypeUrl   string
	TimeStamp int64
}

type InitKeystoreParam

type InitKeystoreParam struct {
	KeystoreName   string
	KeystoreDir    string
	KeystorePwd    string
	DefaultKeyName string
	ConfigDir      string
	PeerName       string
}

type Metadata

type Metadata struct {
	Title string `xml:"title"`
}

type Rootfile

type Rootfile struct {
	Path string `xml:"full-path,attr"`
}

type Segmentinfo

type Segmentinfo struct {
	Id     string `json:"id"`
	Sha256 string `json:"sha256"`
}

type Trx

type Trx struct {
	TrxId   string `json:"TrxId"`
	GroupId string `json:"GroupId"`
}

type TrxResult

type TrxResult struct {
	TrxId string `json:"trx_id"`
}

func HttpPostToGroup

func HttpPostToGroup(apiPrefix string, jsondata []byte) (*TrxResult, error)

Directories

Path Synopsis
cli
api
ui
blocks display in block mode, lower level than other modes
blocks display in block mode, lower level than other modes

Jump to

Keyboard shortcuts

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