Documentation ¶
Overview ¶
Package elevengo is an API client for 115 Cloud Storage Service, it bases on the official APIs that are captures from Web and Desktop App.
Index ¶
- Variables
- type Agent
- func (a *Agent) CredentialExport(cr *Credential)
- func (a *Agent) CredentialImport(cr *Credential) (err error)
- func (a *Agent) DirGetId(path string) (dirId string, err error)
- func (a *Agent) DirMake(parentId string, name string) (dirId string, err error)
- func (a *Agent) DirSetOrder(dirId string, order FileOrder, asc bool) (err error)
- func (a *Agent) DownloadCreateTicket(pickcode string, ticket *DownloadTicket) (err error)
- func (a *Agent) Fetch(url string) (body client.Body, err error)
- func (a *Agent) FetchRange(url string, rng Range) (body client.Body, err error)
- func (a *Agent) FileBatchRename(nameMap map[string]string) (err error)
- func (a *Agent) FileCopy(dirId string, fileIds []string) (err error)
- func (a *Agent) FileDelete(fileIds []string) (err error)
- func (a *Agent) FileGet(fileId string, file *File) (err error)
- func (a *Agent) FileIterate(dirId string) (it Iterator[File], err error)
- func (a *Agent) FileMove(dirId string, fileIds []string) (err error)
- func (a *Agent) FileRename(fileId, newName string) (err error)
- func (a *Agent) FileSearch(dirId, keyword string, options ...*option.FileListOptions) (it Iterator[File], err error)
- func (a *Agent) FileSetLabels(fileId string, labelIds ...string) (err error)
- func (a *Agent) FileSetStar(fileId string, star bool) (err error)
- func (a *Agent) FileWithLabel(labelId string, options ...*option.FileListOptions) (it Iterator[File], err error)
- func (a *Agent) FileWithStar(options ...*option.FileListOptions) (it Iterator[File], err error)
- func (a *Agent) ImageGetUrl(pickcode string) (imageUrl string, err error)
- func (a *Agent) Import(dirId string, ticket *ImportTicket) (err error)
- func (a *Agent) ImportCalculateSignValue(pickcode string, signRange string) (value string, err error)
- func (a *Agent) ImportCreateTicket(fileId string, ticket *ImportTicket) (pickcode string, err error)
- func (a *Agent) LabelCreate(name string, color LabelColor) (labelId string, err error)
- func (a *Agent) LabelDelete(labelId string) (err error)
- func (a *Agent) LabelFind(name string, label *Label) (err error)
- func (a *Agent) LabelIterate() (it Iterator[Label], err error)
- func (a *Agent) LabelSetOrder(labelId string, order FileOrder, asc bool) (err error)
- func (a *Agent) LabelUpdate(label *Label) (err error)
- func (a *Agent) LowlevelClient() client.Client
- func (a *Agent) LowlevelParams() types.CommonParams
- func (a *Agent) OfflineAddUrl(urls []string, options ...*option.OfflineAddOptions) (hashes []string, err error)
- func (a *Agent) OfflineClear(flag OfflineClearFlag) (err error)
- func (a *Agent) OfflineDelete(hashes []string, options ...*option.OfflineDeleteOptions) (err error)
- func (a *Agent) OfflineIterate() (it Iterator[OfflineTask], err error)
- func (a *Agent) QrcodePoll(session *QrcodeSession) (done bool, err error)
- func (a *Agent) QrcodeStart(session *QrcodeSession, options ...*option.QrcodeOptions) (err error)
- func (a *Agent) StorageStat(info *StorageInfo) (err error)
- func (a *Agent) UploadCreateOssTicket(dirId, name string, r io.ReadSeeker, ticket *UploadOssTicket) (err error)
- func (a *Agent) UploadCreateTicket(dirId, name string, r io.ReadSeeker, ticket *UploadTicket) (err error)
- func (a *Agent) UploadParseResult(r io.Reader, file *File) (err error)
- func (a *Agent) UploadSample(dirId, name string, size int64, r io.Reader) (fileId string, err error)
- func (a *Agent) UserGet(info *UserInfo) (err error)
- func (a *Agent) Version() string
- func (a *Agent) VideoCreateTicket(pickcode string, ticket *VideoTicket) (err error)
- type Credential
- type DownloadTicket
- type ErrImportNeedCheck
- type File
- type FileOrder
- type ImportTicket
- type Iterator
- type Label
- type LabelColor
- type OfflineClearFlag
- type OfflineTask
- type QrcodeSession
- type Range
- type StorageInfo
- type UploadOssTicket
- type UploadTicket
- type UserInfo
- type VideoDefinition
- type VideoTicket
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ErrQrcodeCancelled = errors.New("QRcode cancelled")
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent holds signed-in user's credentials, and provides methods to access upstream server's features, such as file management, offline download, etc.
func New ¶
func New(options ...*option.AgentOptions) *Agent
New creates Agent with customized options.
Example ¶
// Customize agent agent := New( option.Agent().WithName("Evangelion/1.0").WithCooldown(100, 500), ) var err error if err = agent.CredentialImport(&Credential{ UID: "", CID: "", SEID: "", }); err != nil { log.Fatalf("Invalid credential, error: %s", err) }
Output:
func (*Agent) CredentialExport ¶ added in v0.1.3
func (a *Agent) CredentialExport(cr *Credential)
CredentialExport exports current credentials for future-use.
func (*Agent) CredentialImport ¶ added in v0.1.3
func (a *Agent) CredentialImport(cr *Credential) (err error)
CredentialImport imports credentials into agent.
Example ¶
agent := Default() // Import credential to agent if err := agent.CredentialImport(&Credential{ UID: "UID-From-Cookie", CID: "CID-From-Cookie", KID: "KID-From-Cookie", SEID: "SEID-From-Cookie", }); err != nil { log.Fatalf("Import credentail error: %s", err) }
Output:
func (*Agent) DirSetOrder ¶ added in v0.2.1
DirSetOrder sets how files under the directory be ordered.
func (*Agent) DownloadCreateTicket ¶ added in v0.1.4
func (a *Agent) DownloadCreateTicket(pickcode string, ticket *DownloadTicket) (err error)
DownloadCreateTicket creates ticket which contains all required information to download a file. Caller can use third-party tools/libraries to download file, such as wget/curl/aria2.
Example ¶
agent := Default() // Create download ticket var err error ticket := DownloadTicket{} if err = agent.DownloadCreateTicket("pickcode", &ticket); err != nil { log.Fatalf("Get download ticket error: %s", err) } // Process download ticket through curl cmd := exec.Command("/usr/bin/curl", ticket.Url) for name, value := range ticket.Headers { cmd.Args = append(cmd.Args, "-H", fmt.Sprintf("%s: %s", name, value)) } cmd.Args = append(cmd.Args, "-o", ticket.FileName) if err = cmd.Run(); err != nil { log.Fatal(err) } else { log.Printf("File downloaded to %s", ticket.FileName) }
Output:
func (*Agent) Fetch ¶ added in v0.5.1
Fetch gets content from url using agent underlying HTTP client.
func (*Agent) FetchRange ¶ added in v0.5.1
FetchRange gets partial content from |url|, which is located by |rng|.
func (*Agent) FileBatchRename ¶ added in v0.5.1
FileBatchRename renames multiple files.
func (*Agent) FileDelete ¶
FileDelete deletes files.
func (*Agent) FileIterate ¶ added in v0.2.2
FileIterate list files under directory, whose id is |dirId|.
Example ¶
agent := Default() it, err := agent.FileIterate("0") if err != nil { log.Fatalf("Iterate file failed: %s", err.Error()) } log.Printf("File count: %d", it.Count()) for index, file := range it.Items() { log.Printf("File: %d => %#v", index, file) }
Output:
func (*Agent) FileRename ¶
FileRename renames file to new name.
func (*Agent) FileSearch ¶
func (a *Agent) FileSearch( dirId, keyword string, options ...*option.FileListOptions, ) (it Iterator[File], err error)
FileSearch recursively searches files under a directory, whose name contains the given keyword.
func (*Agent) FileSetLabels ¶ added in v0.2.1
FileSetLabels sets labels for a file, you can also remove all labels from it by not passing any labelId.
func (*Agent) FileSetStar ¶ added in v0.5.1
FileSetStar adds/removes star from a file, whose ID is fileId.
func (*Agent) FileWithLabel ¶ added in v0.5.1
func (a *Agent) FileWithLabel( labelId string, options ...*option.FileListOptions, ) (it Iterator[File], err error)
FileLabeled lists files which has specific label.
func (*Agent) FileWithStar ¶ added in v0.5.1
FileWithStar lists files with star.
func (*Agent) ImageGetUrl ¶ added in v0.2.1
ImageGetUrl gets an accessible URL of an image file by its pickcode.
func (*Agent) Import ¶ added in v0.2.1
func (a *Agent) Import(dirId string, ticket *ImportTicket) (err error)
Import imports(aka. rapid-upload) a file to your 115 cloud storage. Please check example code for the detailed usage.
Example ¶
var err error // Initialize two agents for sender and receiver sender, receiver := Default(), Default() sender.CredentialImport(&Credential{ UID: "", CID: "", SEID: "", }) receiver.CredentialImport(&Credential{ UID: "", CID: "", SEID: "", }) // File to send on sender's storage fileId := "12345678" // Create import ticket by sender ticket, pickcode := &ImportTicket{}, "" if pickcode, err = sender.ImportCreateTicket(fileId, ticket); err != nil { log.Fatalf("Get file info failed: %s", err) } // Directory to save file on receiver's storage dirId := "0" // Call Import first time if err = receiver.Import(dirId, ticket); err != nil { if ie, ok := err.(*ErrImportNeedCheck); ok { // Calculate sign value by sender signValue, err := sender.ImportCalculateSignValue(pickcode, ie.SignRange) if err != nil { log.Fatalf("Calculate sign value failed: %s", err) } // Update ticket and import again ticket.SignKey, ticket.SignValue = ie.SignKey, signValue if err = receiver.Import(dirId, ticket); err == nil { log.Print("Import succeeded!") } else { log.Fatalf("Import failed: %s", err) } } else { log.Fatalf("Import failed: %s", err) } } else { log.Print("Import succeeded!") }
Output:
func (*Agent) ImportCalculateSignValue ¶ added in v0.4.2
func (a *Agent) ImportCalculateSignValue(pickcode string, signRange string) (value string, err error)
ImportCalculateSignValue calculates sign value of a file on cloud storage. Please check example code for the detailed usage.
func (*Agent) ImportCreateTicket ¶ added in v0.3.1
func (a *Agent) ImportCreateTicket(fileId string, ticket *ImportTicket) (pickcode string, err error)
ImportCreateTicket is a helper function to create an ImportTicket of a file, that you can share to others to import this file to their cloud storage. You should also send pickcode together with ticket.
func (*Agent) LabelCreate ¶ added in v0.2.1
func (a *Agent) LabelCreate(name string, color LabelColor) (labelId string, err error)
LabelCreate creates a label with name and color, returns its ID.
func (*Agent) LabelDelete ¶ added in v0.2.1
LabelDelete deletes a label whose ID is labelId.
func (*Agent) LabelIterate ¶ added in v0.2.1
func (*Agent) LabelSetOrder ¶ added in v0.5.1
func (*Agent) LabelUpdate ¶ added in v0.2.1
LabelUpdate updates label's name or color.
func (*Agent) LowlevelClient ¶ added in v0.6.1
LowlevelClient returns low-level client that can be used to directly call ApiSpec.
func (*Agent) LowlevelParams ¶ added in v0.6.3
func (a *Agent) LowlevelParams() types.CommonParams
LowlevelParams returns common parameters for low-level API calling.
func (*Agent) OfflineAddUrl ¶ added in v0.4.6
func (a *Agent) OfflineAddUrl(urls []string, options ...*option.OfflineAddOptions) (hashes []string, err error)
OfflineAddUrl adds offline tasks by download URLs. It returns an info hash list related to the given urls, the info hash will be empty if the related URL is invalid.
You can use options to change the download directory:
agent := Default() agent.CredentialImport(&Credential{UID: "", CID: "", SEID: ""}) hashes, err := agent.OfflineAddUrl([]string{ "https://foo.bar/file.zip", "magent:?xt=urn:btih:111222", "ed2k://|file|name|size|md4|", }, option.OfflineSaveDownloadedFileTo("dirId"))
func (*Agent) OfflineClear ¶
func (a *Agent) OfflineClear(flag OfflineClearFlag) (err error)
OfflineClear clears tasks which is in specific status.
func (*Agent) OfflineDelete ¶
func (a *Agent) OfflineDelete(hashes []string, options ...*option.OfflineDeleteOptions) (err error)
OfflineDelete deletes tasks.
func (*Agent) OfflineIterate ¶ added in v0.2.1
func (a *Agent) OfflineIterate() (it Iterator[OfflineTask], err error)
OfflineIterate returns an iterator to access all offline tasks.
Example ¶
agent := Default() it, err := agent.OfflineIterate() if err == nil { log.Printf("Task count: %d", it.Count()) for index, task := range it.Items() { log.Printf("Offline task: %d => %#v", index, task) } } else { log.Fatalf("Iterate offline task failed: %s", err) }
Output:
func (*Agent) QrcodePoll ¶ added in v0.5.1
func (a *Agent) QrcodePoll(session *QrcodeSession) (done bool, err error)
QrcodePoll polls the session state, and automatically sin
func (*Agent) QrcodeStart ¶
func (a *Agent) QrcodeStart(session *QrcodeSession, options ...*option.QrcodeOptions) (err error)
QrcodeStart starts a QRcode sign-in session. The session is for web by default, you can change sign-in app by passing a "option.QrcodeLoginOption".
Example:
agent := elevengo.Default() session := elevengo.QrcodeSession() agent.QrcodeStart(session, option.Qrcode().LoginTv())
Example ¶
agent := Default() session := &QrcodeSession{} err := agent.QrcodeStart(session) if err != nil { log.Fatalf("Start QRcode session error: %s", err) } // TODO: Show QRcode and ask user to scan it via 115 app. for done := false; !done && err != nil; { done, err = agent.QrcodePoll(session) } if err != nil { log.Fatalf("QRcode login failed, error: %s", err) }
Output:
func (*Agent) StorageStat ¶
func (a *Agent) StorageStat(info *StorageInfo) (err error)
StorageStat gets storage size information.
func (*Agent) UploadCreateOssTicket ¶ added in v0.3.2
func (a *Agent) UploadCreateOssTicket( dirId, name string, r io.ReadSeeker, ticket *UploadOssTicket, ) (err error)
UploadCreateOssTicket creates ticket to upload file through aliyun-oss-sdk. Use this method if you want to upload a file larger than 5G bytes.
To create ticket, r will be fully read to calculate SHA-1 and MD5 hash value. If you want to re-use r, try to seek it to beginning.
Example:
import ( "github.com/aliyun/aliyun-oss-go-sdk/oss" "github.com/deadblue/elevengo" ) func main() { filePath := "/file/to/upload" var err error file, err := os.Open(filePath) if err != nil { log.Fatalf("Open file failed: %s", err) } defer file.Close() // Create 115 agent agent := elevengo.Default() if err = agent.CredentialImport(&elevengo.Credential{ UID: "", CID: "", SEID: "", }); err != nil { log.Fatalf("Login failed: %s", err) } // Prepare OSS upload ticket ticket := &UploadOssTicket{} if err = agent.UploadCreateOssTicket( "dirId", filepath.Base(file.Name()), file, ticket, ); err != nil { log.Fatalf("Create OSS ticket failed: %s", err) } if ticket.Exist { log.Printf("File has been fast-uploaded!") return } // Create OSS client oc, err := oss.New( ticket.Client.Endpoint, ticket.Client.AccessKeyId, ticket.Client.AccessKeySecret, oss.SecurityToken(ticket.Client.SecurityToken) ) if err != nil { log.Fatalf("Create OSS client failed: %s", err) } bucket, err := oc.Bucket(ticket.Bucket) if err != nil { log.Fatalf("Get OSS bucket failed: %s", err) } // Upload file in multipart. err = bucket.UploadFile( ticket.Object, filePath, 100 * 1024 * 1024, // 100 Megabytes per part oss.Callback(ticket.Callback), oss.CallbackVar(ticket.CallbackVar), ) // Until now (2023-01-29), there is a bug in aliyun-oss-go-sdk: // When set Callback option, the response from CompleteMultipartUpload API // is returned by callback host, which is not the standard XML. But SDK // always tries to parse it as CompleteMultipartUploadResult, and returns // `io.EOF` error, just ignore it! if err != nil && err != io.EOF { log.Fatalf("Upload file failed: %s", err) } else { log.Print("Upload done!") } }
func (*Agent) UploadCreateTicket ¶ added in v0.1.4
func (a *Agent) UploadCreateTicket( dirId, name string, r io.ReadSeeker, ticket *UploadTicket, ) (err error)
UploadCreateTicket creates a ticket which contains all required parameters to upload file/data to cloud, the ticket should be used in 1 hour.
To create ticket, r will be fully read to calculate SHA-1 and MD5 hash value. If you want to re-use r, try to seek it to beginning.
To upload a file larger than 5G bytes, use `UploadCreateOssTicket`.
Example ¶
agent := Default() filename := "/path/to/file" file, err := os.Open(filename) if err != nil { log.Fatalf("Open file failed: %s", err.Error()) } ticket := &UploadTicket{} if err = agent.UploadCreateTicket("dirId", path.Base(filename), file, ticket); err != nil { log.Fatalf("Create upload ticket failed: %s", err.Error()) } if ticket.Exist { log.Printf("File already exists!") return } // Make temp file to receive upload result tmpFile, err := os.CreateTemp("", "curl-upload-*") if err != nil { log.Fatalf("Create temp file failed: %s", err) } defer func() { _ = tmpFile.Close() _ = os.Remove(tmpFile.Name()) }() // Use "curl" to upload file cmd := exec.Command("curl", ticket.Url, "-o", tmpFile.Name(), "-#", "-T", filename) for name, value := range ticket.Header { cmd.Args = append(cmd.Args, "-H", fmt.Sprintf("%s: %s", name, value)) } if err = cmd.Run(); err != nil { log.Fatalf("Upload failed: %s", err) } // Parse upload result uploadFile := &File{} if err = agent.UploadParseResult(tmpFile, uploadFile); err != nil { log.Fatalf("Parse upload result failed: %s", err) } else { log.Printf("Uploaded file: %#v", file) }
Output:
func (*Agent) UploadParseResult ¶ added in v0.1.4
UploadParseResult parses the raw upload response, and fills it to file.
func (*Agent) UploadSample ¶ added in v0.5.1
func (a *Agent) UploadSample(dirId, name string, size int64, r io.Reader) (fileId string, err error)
UploadSample directly uploads small file/data (smaller than 200MB) to cloud.
func (*Agent) VideoCreateTicket ¶ added in v0.5.1
func (a *Agent) VideoCreateTicket(pickcode string, ticket *VideoTicket) (err error)
VideoCreateTicket creates a PlayTicket to play the cloud video.
Example ¶
agent := Default() // Create video play ticket ticket := &VideoTicket{} err := agent.VideoCreateTicket("pickcode", ticket) if err != nil { log.Fatalf("Get video info failed: %s", err) } headers := make([]string, 0, len(ticket.Headers)) for name, value := range ticket.Headers { headers = append(headers, fmt.Sprintf("'%s: %s'", name, value)) } // Play HLS through mpv cmd := exec.Command("mpv") cmd.Args = append(cmd.Args, fmt.Sprintf("--http-header-fields=%s", strings.Join(headers, ",")), ticket.Url, ) cmd.Run()
Output:
type Credential ¶ added in v0.1.3
Credential contains required information which 115 server uses to authenticate a signed-in user. In detail, these cookies are required: "UID", "CID", "KID", "SEID". Caller can find them from browser cookie storage.
type DownloadTicket ¶
type DownloadTicket struct { // Download URL. Url string // Request headers which SHOULD be sent with download URL. Headers map[string]string // File name. FileName string // File size in bytes. FileSize int64 }
DownloadTicket contains all required information to download a file.
type ErrImportNeedCheck ¶ added in v0.4.2
type ErrImportNeedCheck struct { // The sign key your should set to ImportTicket SignKey string // The sign range in format of "<start>-<end>" in bytes. // You can directly use it in ImportCreateTicket. SignRange string }
func (*ErrImportNeedCheck) Error ¶ added in v0.4.2
func (e *ErrImportNeedCheck) Error() string
type File ¶
type File struct { // Marks is the file a directory. IsDirectory bool // Unique identifier of the file on the cloud storage. FileId string // FileId of the parent directory. ParentId string // Base name of the file. Name string // Size in bytes of the file. Size int64 // Identifier used for downloading or playing the file. PickCode string // SHA1 hash of file content, in HEX format. Sha1 string // Is file stared Star bool // File labels Labels []Label // Last modified time ModifiedTime time.Time // Play duration in seconds, for audio/video files. MediaDuration float64 // Is file a video. IsVideo bool // Definition of the video file. VideoDefinition VideoDefinition }
File describe a file or directory on cloud storage.
type ImportTicket ¶ added in v0.2.1
type ImportTicket struct { // File base name FileName string // File size in bytes FileSize int64 // File SHA-1 hash, in upper-case HEX format FileSha1 string // Sign key from 115 server. SignKey string // SHA-1 hash value of a segment of the file, in upper-case HEX format SignValue string }
ImportTicket container reqiured fields to import(aka. quickly upload) a file to your 115 cloud storage.
type Iterator ¶ added in v0.2.1
type Iterator[T any] interface { // Count return the count of items. Count() int // Items return an index-item sequence. Items() iter.Seq2[int, *T] }
Iterator iterate items.
type Label ¶ added in v0.2.1
type Label struct { Id string Name string Color LabelColor }
type LabelColor ¶ added in v0.2.1
type LabelColor int
const ( LabelColorBlank LabelColor = iota LabelColorRed LabelColorOrange LabelColorYellow LabelColorGreen LabelColorBlue LabelColorPurple LabelColorGray )
type OfflineClearFlag ¶
type OfflineClearFlag int
const ( OfflineClearDone OfflineClearFlag = iota OfflineClearAll OfflineClearFailed OfflineClearRunning OfflineClearDoneAndDelete OfflineClearAllAndDelete )
type OfflineTask ¶
type OfflineTask struct { InfoHash string Name string Size int64 Status int Percent float64 Url string FileId string }
OfflineTask describe an offline downloading task.
func (*OfflineTask) IsDone ¶ added in v0.2.1
func (t *OfflineTask) IsDone() bool
func (*OfflineTask) IsFailed ¶ added in v0.2.1
func (t *OfflineTask) IsFailed() bool
func (*OfflineTask) IsRunning ¶ added in v0.2.1
func (t *OfflineTask) IsRunning() bool
type QrcodeSession ¶
type QrcodeSession struct { // QRCode image content. Image []byte // contains filtered or unexported fields }
QrcodeSession holds the information during a QRCode login process.
func (*QrcodeSession) Marshal ¶ added in v0.5.2
func (s *QrcodeSession) Marshal() string
Marshal marshals QrcodeSession into a string, which can be tranfered out of process.
func (*QrcodeSession) Unmarshal ¶ added in v0.5.2
func (s *QrcodeSession) Unmarshal(text string) (err error)
Unmarshal fills QrcodeSession from a string which is generated by |Marshal|.
type Range ¶ added in v0.3.2
type Range struct {
// contains filtered or unexported fields
}
Range is used in Agent.GetRange().
func RangeFirst ¶ added in v0.3.2
RangeFirst makes a Range parameter to request the first `length` bytes.
func RangeLast ¶ added in v0.3.2
RangeLast makes a Range parameter to request the last `length` bytes.
func RangeMiddle ¶ added in v0.3.2
RangeMiddle makes a Range parameter to request content starts from `offset`, and has `length` bytes (at most).
You can pass a negative number in `length`, to request content starts from `offset` to the end.
type StorageInfo ¶
type StorageInfo struct { // Total size in bytes. Size int64 // Human-readable total size. FormatSize string // Used size in bytes. Used int64 // Human-readable used size. FormatUsed string // Available size in bytes. Avail int64 // Human-readable remain size. FormatAvail string }
StorageInfo describes storage space usage.
type UploadOssTicket ¶ added in v0.3.2
type UploadOssTicket struct { // Expiration time Expiration time.Time // Is file already exists Exist bool // Client parameters Client struct { Region string Endpoint string AccessKeyId string AccessKeySecret string SecurityToken string } // Bucket name Bucket string // Object key Object string // Callback option Callback string // CallbackVar option CallbackVar string }
UploadOssTicket contains all required paramters to upload a file through aliyun-oss-sdk(https://github.com/aliyun/aliyun-oss-go-sdk).
type UploadTicket ¶
type UploadTicket struct { // Expiration time Expiration time.Time // Is file exists Exist bool // Request method Verb string // Remote URL which will receive the file content. Url string // Request header Header map[string]string }
UploadTicket contains all required information to upload a file.
type VideoDefinition ¶ added in v0.5.2
type VideoDefinition int
VideoDefinition values from 115.
const ( // Standard Definition, aka. 480P. VideoDefinitionSD VideoDefinition = 1 // High Definition, aka. 720P. VideoDefinitionHD VideoDefinition = 2 // Full-HD, aka. 1080P. VideoDefinitionFHD VideoDefinition = 3 // Another 1080P, what the fuck? VideoDefinition1080P VideoDefinition = 4 // 4K Definition, aka. Ultra-HD. VideoDefinition4K VideoDefinition = 5 // The fallback definition, usually for non-standard resolution. VideoDefinitionOrigin VideoDefinition = 100 )
type VideoTicket ¶ added in v0.5.1
type VideoTicket struct { // Play URL, it is normally a m3u8 URL. Url string // Request headers which SHOULD be sent with play URL. Headers map[string]string // File name. FileName string // File size. FileSize int64 // Video duration in seconds. Duration float64 // Video width. Width int // Video height. Height int }
VideoTicket contains all required arguments to play a cloud video.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
Package lowlevel exposes the low-level API client and specs that are used by Agent.
|
Package lowlevel exposes the low-level API client and specs that are used by Agent. |
Package plugin declares some interfaces that allow developer customizing elevengo agent.
|
Package plugin declares some interfaces that allow developer customizing elevengo agent. |