-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
88 lines (77 loc) · 2.32 KB
/
types.go
File metadata and controls
88 lines (77 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package ffsendgo
import (
"bytes"
"crypto/cipher"
"io"
"github.com/gorilla/websocket"
)
type ServerLimits struct {
MaxFileSize int64 `json:"MAX_FILE_SIZE"`
MaxDownloads int `json:"MAX_DOWNLOADS"`
MaxExpireSeconds int `json:"MAX_EXPIRE_SECONDS"`
}
type ServerDefaults struct {
Downloads int `json:"DOWNLOADS"`
DownloadCounts []int `json:"DOWNLOAD_COUNTS"`
ExpireSeconds int `json:"EXPIRE_SECONDS"`
ExpireTimesSeconds []int `json:"EXPIRE_TIMES_SECONDS"`
}
type Keychain struct {
MasterKey, AuthKey, MetaKey []byte
}
type eceWriter struct {
ws *websocket.Conn
ikm, salt, contentEncKey, nonceBase []byte
gcm cipher.AEAD
buffer *bytes.Buffer
seq uint32
totalWritten, fileSize int64
}
type ManifestFile struct {
Name string `json:"name"`
Type string `json:"type"`
Size int64 `json:"size"`
}
type Manifest struct {
Files []ManifestFile `json:"files"`
}
type FileMetadataV3 struct {
Name string `json:"name"`
Type string `json:"type"`
Size int64 `json:"size"`
Manifest Manifest `json:"manifest"`
}
type FileInfo struct {
TimeLimit int `json:"timeLimit"`
DownloadLimit int `json:"dlimit"`
FileMetadata string `json:"fileMetadata"`
Authorization string `json:"authorization"`
}
type UploadResponse struct{ ID, URL, OwnerToken string }
type UploadStatusResponse struct {
OK bool `json:"ok"`
}
type eceReader struct {
innerReader io.Reader
ikm, salt, contentEncKey, nonceBase []byte
gcm cipher.AEAD
recordSize uint32
seq uint32
buffer *bytes.Buffer
isInitialized bool
isEOF bool
}
type MetadataResponse struct {
Metadata string `json:"metadata"`
}
type ProviderInfo struct {
URL string `json:"url"`
Error string `json:"error,omitempty"`
MaxFileSize int64 `json:"max_file_size,omitempty"`
MaxDownloads int `json:"max_downloads,omitempty"`
MaxExpireSeconds int `json:"max_expire_seconds,omitempty"`
}
type InstanceStatus struct {
URL string `json:"url"`
Status string `json:"status"`
}