Documentation
¶
Index ¶
- Constants
- Variables
- func CompressFolder(input_folder, dest_file string) (err error)
- func Critical(err error)
- func DateString(input time.Time) string
- func EnableDebug()
- func Err(input ...interface{})
- func ErrorCount() uint32
- func HumanSize(bytes int64) string
- func IsKWError(err error) bool
- func KVLiteStore(input *Database) *kvLiteStore
- func KWAPIError(err error, input int64) bool
- func MD5Sum(filename string) (sum string, err error)
- func MkDir(name ...string) (err error)
- func Quiet()
- func RandBytes(sz int) []byte
- func ReadKWTime(input string) (time.Time, error)
- func ResetErrorCount()
- func SetParams(vars ...interface{}) (output []interface{})
- func Spanner(input interface{}) string
- func SplitPath(path string) (folder_path []string)
- func WriteKWTime(input time.Time) string
- type APIRequest
- type BitFlag
- type Database
- func (d Database) Close()
- func (d Database) CountKeys(table string) int
- func (d Database) CryptSet(table, key string, value interface{})
- func (d Database) Drop(table string)
- func (d Database) Get(table, key string, output interface{}) bool
- func (d Database) Keys(table string) []string
- func (d Database) Set(table, key string, value interface{})
- func (d Database) Table(table string) Table
- func (d Database) Tables() []string
- func (d Database) Unset(table, key string)
- type Error
- type FileInfo
- type KWAPI
- func (K *KWAPI) AuthLoop(username string) (*KWSession, error)
- func (K *KWAPI) Authenticate(username string) (*KWSession, error)
- func (K *KWAPI) Chunks(total_size int64) (total_chunks int64)
- func (K *KWAPI) ClientSecret(client_secret_key string)
- func (K *KWAPI) Session(username string) KWSession
- func (K *KWAPI) SetLimiter(max_calls int)
- func (K *KWAPI) SetTransferLimiter(max_transfers int)
- func (K *KWAPI) Signature(signature_key string)
- type KWAPIClient
- type KWAuth
- type KWError
- type KWSession
- func (s KWSession) Call(api_req APIRequest) (err error)
- func (s KWSession) DataCall(req APIRequest, offset, limit int) (err error)
- func (S *KWSession) Download(req *http.Request) ReadSeekCloser
- func (s KWSession) NewClient() *KWAPIClient
- func (s KWSession) NewRequest(method, path string, api_ver int) (req *http.Request, err error)
- func (S *KWSession) NewUpload(folder_id int, filename string, file_size int64) (int, error)
- func (S *KWSession) NewVersion(file_id int, filename string, file_size int64) (int, error)
- func (s KWSession) Upload(filename string, upload_id int, source_reader ReadSeekCloser) (int, error)
- type PostForm
- type PostJSON
- type Query
- type ReadSeekCloser
- type Table
- type TokenStore
Constants ¶
const ( ERR_AUTH_UNAUTHORIZED = 1 << iota ERR_AUTH_PROFILE_CHANGED ERR_ACCESS_USER ERR_INVALID_GRANT ERR_ENTITY_DELETED_PERMANENTLY ERR_ENTITY_NOT_FOUND ERR_ENTITY_DELETED ERR_ENTITY_PARENT_FOLDER_DELETED ERR_REQUEST_METHOD_NOT_ALLOWED ERR_INTERNAL_SERVER_ERROR ERR_ENTITY_EXISTS ERR_ENTITY_ROLE_IS_ASSIGNED UNAVAILABLE SERVICE_UNAVAILABLE ERR_ENTITY_NOT_SCANNED ERR_ENTITY_PARENT_FOLDER_MEMBER_EXISTS )
const ( NONE = "" SLASH = string(os.PathSeparator) )
const TOKEN_ERR = ERR_AUTH_PROFILE_CHANGED | ERR_INVALID_GRANT | ERR_AUTH_UNAUTHORIZED
Auth token related errors.
Variables ¶
var ( Log = nfo.Log Fatal = nfo.Fatal Notice = nfo.Notice Flash = nfo.Flash Stdout = nfo.Stdout Warn = nfo.Warn Defer = nfo.Defer Debug = nfo.Debug Snoop = nfo.Aux GetSecret = nfo.GetSecret GetInput = nfo.GetInput Exit = nfo.Exit PleaseWait = nfo.PleaseWait Stderr = nfo.Stderr GetConfirm = nfo.GetConfirm HideTS = nfo.HideTS ShowTS = nfo.ShowTS ProgressBar = nfo.ProgressBar TransferMonitor = nfo.TransferMonitor Path = filepath.Clean LeftToRight = nfo.LeftToRight RightToLeft = nfo.RightToLeft NoRate = nfo.NoRate NeedAnswer = nfo.NeedAnswer PressEnter = nfo.PressEnter )
Import from go-nfo.
var ErrNoUploadID = fmt.Errorf("Upload ID not found.")
var ErrUploadNoResp = fmt.Errorf("Unexpected empty resposne from server.")
var SetPath = fmt.Sprintf
SetPath shortcut.
Functions ¶
func CompressFolder ¶
Compresses Folder to File
func DateString ¶
Create standard date YY-MM-DD out of time.Time.
func KVLiteStore ¶
func KVLiteStore(input *Database) *kvLiteStore
Wraps KVLite Databse as a auth token store.
func ResetErrorCount ¶
func ResetErrorCount()
func SetParams ¶
func SetParams(vars ...interface{}) (output []interface{})
Creates Param for KWAPI post
Types ¶
type APIRequest ¶
type APIRequest struct { APIVer int Method string Path string Params []interface{} Output interface{} }
APIRequest model
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Wrapper around go-kvlite.
func OpenDatabase ¶
Opens go-kvlite sqlite database.
func SecureDatabase ¶
Opens go-kvlite database using mac address for lock.
type KWAPI ¶
type KWAPI struct { Server string // kiteworks host name. ApplicationID string // Application ID set for kiteworks custom app. RedirectURI string // Redirect URI for kiteworks custom app. AgentString string // Agent-String header for calls to kiteworks. VerifySSL bool // Verify certificate for connections. ProxyURI string // Proxy for outgoing https requests. Snoop bool // Flag to snoop API calls RequestTimeout time.Duration // Timeout for request to be answered from kiteworks server. ConnectTimeout time.Duration // Timeout for TLS connection to kiteworks server. MaxChunkSize int64 // Max Upload Chunksize in bytes, min = 1M, max = 68M Retries uint // Max retries on a failed call TokenStore TokenStore // TokenStore for reading and writing auth tokens securely. // contains filtered or unexported fields }
func (*KWAPI) ClientSecret ¶
Sets client secret key.
func (*KWAPI) SetLimiter ¶
Configures maximum number of simultaneous api calls.
func (*KWAPI) SetTransferLimiter ¶
Configures maximum number of simultaneous file transfers.
type KWAPIClient ¶
KWAPI Client
type KWAuth ¶
type KWAuth struct { AccessToken string `json:"access_token"` Scope string `json:"scope"` RefreshToken string `json:"refresh_token"` Expires int64 `json:"expires_in"` }
kiteworks Auth token.
type KWError ¶
type KWError struct {
// contains filtered or unexported fields
}
Specific kiteworks error object.
type KWSession ¶
kiteworks Session.
func (KWSession) Call ¶
func (s KWSession) Call(api_req APIRequest) (err error)
kiteworks API Call Wrapper
func (KWSession) DataCall ¶
func (s KWSession) DataCall(req APIRequest, offset, limit int) (err error)
Call handler which allows for easier getting of multiple-object arrays. An offset of -1 will provide all results, any positive offset will only return the requested results.
func (*KWSession) Download ¶
func (S *KWSession) Download(req *http.Request) ReadSeekCloser
Perform External Download from a remote request.
func (KWSession) NewRequest ¶
New kiteworks Request.
func (*KWSession) NewVersion ¶
Create a new file version for an existing file.
type ReadSeekCloser ¶
type ReadSeekCloser = nfo.ReadSeekCloser