Documentation ¶
Index ¶
- Variables
- type AuthResp
- type Authentication
- type CabinetSearchResponse
- type CabinetSearchResult
- type Cabinets
- type CabinetsResponse
- type Client
- func (client *Client) AddFolder(f Folder) (folder Folder, err error)
- func (client Client) Do(req *http.Request) (*http.Response, error)
- func (client *Client) FilesAdd(file FilesAddRequest) (err error)
- func (client *Client) FilesDownload(filesDownload FilesDownloadRequest) (file FilesDownloadResponse, err error)
- func (client *Client) FilesGetFilesInFolder(department string, cabinet string, folderId int) (files FilesInFolder, err error)
- func (client *Client) FilesUploadToFolder(file FilesUploadToFolderRequest) (fileId int, err error)
- func (client *Client) GetDepartments() (deps Departments, err error)
- func (client *Client) GetDocumentTypes(department, cabinet string) (dTypes DocumentTypes, err error)
- func (client *Client) GetFolders(department string, cabinet string) (f Folders, err error)
- func (client *Client) GetSavedTabs(department string, cabinet string) (f TabInfoList, err error)
- func (client Client) GetServerResponse(url string, method string, body io.Reader) (resp *http.Response, err error)
- func (client *Client) GetTabInfo(department string, cabinet string, folder string) (f TabInfoList, err error)
- func (client *Client) GetWorkflowDefinitions() (result WorkflowDefinitionsResponse, err error)
- func (client *Client) ListCabinets() (cabinets Cabinets, err error)
- func (client Client) NewAuthRequest(path string, method string, body io.Reader) (req *http.Request, err error)
- func (client *Client) SearchCabinet(cabinet string, query ...IndexQuery) (results []CabinetSearchResult, err error)
- func (client *Client) StartWorkflow(w Workflow) (result StartWorkflowResponse, err error)
- type Config
- type DepartmentResponse
- type Departments
- type DocumentTypes
- type DocumentTypesResponse
- type File
- type FilesAddRequest
- type FilesAddResponse
- type FilesDownloadRequest
- type FilesDownloadResponse
- type FilesGetFilesInFolderResponse
- type FilesInFolder
- type FilesUploadToFolderRequest
- type FilesUploadToFolderResponse
- type Folder
- type FolderAddResponse
- type Folders
- type FoldersResponse
- type Index
- type IndexQuery
- type Indices
- type StartWorkflowResponse
- type StartWorkflowResult
- type TabInfoList
- type TabInfoResponse
- type TabRequest
- type User
- type Workflow
- type WorkflowDefinition
- type WorkflowDefinitionsResponse
Constants ¶
This section is empty.
Variables ¶
var ErrNotImplemented = fmt.Errorf("not implemented")
ErrNotImplemented this method isn't implemented yet
Functions ¶
This section is empty.
Types ¶
type AuthResp ¶
type AuthResp struct { Authentication Authentication `json:"authentication"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
AuthResp authentication response
type Authentication ¶
type Authentication struct { User User `json:"user"` Token string `json:"token"` RefreshToken string `json:"refreshToken"` Expiration treenoTime `json:"expiration"` }
Authentication authentication info
type CabinetSearchResponse ¶
type CabinetSearchResponse struct { Results []CabinetSearchResult `json:"results"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
CabinetSearchResponse contains results from a search, and errors if there was errors
type CabinetSearchResult ¶
type CabinetSearchResult struct { DocId int `json:"docId"` Indices Indices `json:"cabinetIndices"` }
CabinetSearchResult is the contents of a Cabinet Search
type Cabinets ¶
type Cabinets []struct { IsAutoComplete bool `json:"isAutoComplete"` SavedTabs []string `json:"savedTabs"` DataTypeDefinitions struct{} `json:"dataTypeDefinitions"` Indices []string `json:"indices"` DepartmentRealName string `json:"departmentRealName"` DepartmentDisplayName string `json:"departmentDisplayName"` IsDocumentView bool `json:"isDocumentView"` CabinetID int `json:"cabinetId"` RealName string `json:"realName"` DisplayName string `json:"displayName"` }
Cabinets slice of cabinets for the department
type CabinetsResponse ¶
type CabinetsResponse struct { Cabinets Cabinets `json:"cabinets"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
CabinetsResponse response containing any errors and the Cabinets
type Client ¶
type Client struct { Authentication Authentication DefaultDepartment string // contains filtered or unexported fields }
Client treeno client containing an http.Client that makes requests
func NewService ¶
NewService Create a new service with the config, and set a default department
func (*Client) FilesAdd ¶
func (client *Client) FilesAdd(file FilesAddRequest) (err error)
FilesAdd Adds a selected file to specific subfolder/tab TODO NOT IMPLEMENTED and also not needed maybe?
func (*Client) FilesDownload ¶
func (client *Client) FilesDownload(filesDownload FilesDownloadRequest) (file FilesDownloadResponse, err error)
FilesDownload download a file TODO NOT TESTED
func (*Client) FilesGetFilesInFolder ¶
func (client *Client) FilesGetFilesInFolder(department string, cabinet string, folderId int) (files FilesInFolder, err error)
FilesGetFilesInFolder TODO NOT TESTED department real name cabinet real name
func (*Client) FilesUploadToFolder ¶
func (client *Client) FilesUploadToFolder(file FilesUploadToFolderRequest) (fileId int, err error)
FilesUploadToFolder Upload a file to a folder
func (*Client) GetDepartments ¶
func (client *Client) GetDepartments() (deps Departments, err error)
GetDepartments get departments
func (*Client) GetDocumentTypes ¶
func (client *Client) GetDocumentTypes(department, cabinet string) (dTypes DocumentTypes, err error)
GetDocumentTypes Get a list of document types for a cabinet in a department TODO UNTESTED
func (*Client) GetFolders ¶
GetFolders return list of folders in a cabinet
func (*Client) GetSavedTabs ¶
func (client *Client) GetSavedTabs(department string, cabinet string) (f TabInfoList, err error)
GetSavedTabs Gets list of saved tabs name for a cabinet
func (Client) GetServerResponse ¶
func (client Client) GetServerResponse(url string, method string, body io.Reader) (resp *http.Response, err error)
GetServerResponse by doing an auth request
func (*Client) GetTabInfo ¶
func (client *Client) GetTabInfo(department string, cabinet string, folder string) (f TabInfoList, err error)
GetTabInfo UNTESTED, im not sure what this is for. I just noticed that it's a post not a get returns list of tabs for a folder in a cabinet.
func (*Client) GetWorkflowDefinitions ¶ added in v0.0.5
func (client *Client) GetWorkflowDefinitions() (result WorkflowDefinitionsResponse, err error)
GetWorkflowDefinitions gets a list of available workflow ids and names
func (*Client) ListCabinets ¶
ListCabinets Returns a list of cabinets in a department
func (Client) NewAuthRequest ¶
func (client Client) NewAuthRequest(path string, method string, body io.Reader) (req *http.Request, err error)
NewAuthRequest with auth header and body
func (*Client) SearchCabinet ¶
func (client *Client) SearchCabinet(cabinet string, query ...IndexQuery) (results []CabinetSearchResult, err error)
SearchCabinet Searches cabinet for folders by index value Gotcha: Cabinet index names are all lower case for some reason
func (*Client) StartWorkflow ¶ added in v0.0.3
func (client *Client) StartWorkflow(w Workflow) (result StartWorkflowResponse, err error)
StartWorkflow from a workflow request
type Config ¶
Config Config required to create a client
func (*Config) Authenticate ¶
func (conf *Config) Authenticate() (*Authentication, error)
Authenticate authenticates to the treeno API
type DepartmentResponse ¶
type DepartmentResponse struct { Departments Departments `json:"departments"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
DepartmentResponse response for GetDepartments
type Departments ¶
Departments slice of departments in treeno
type DocumentTypes ¶
type DocumentTypes []struct { DocumentTypeID int `json:"documentTypeID"` DocumentTypeEnabled int `json:"documentTypeEnabled"` InternalName string `json:"internalName"` DisplayName string `json:"displayName"` Indices []struct { ID int `json:"id"` Index string `json:"index"` Value string `json:"value"` } `json:"indices"` DocTypeIndexDefs []struct { IndexName string `json:"indexName"` DefinitionList []string `json:"definitionList"` } `json:"docTypeIndexDefs"` }
DocumentTypes in a given department and cabinet
type DocumentTypesResponse ¶
type DocumentTypesResponse struct { DocumentTypes DocumentTypes `json:"documentTypes"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
DocumentTypesResponse Response containing any errors and the DocumentTypes
type File ¶
type File struct { FileID int `json:"fileId"` FileFullName string `json:"fileFullName"` Department string `json:"department"` Cabinet string `json:"cabinet"` FolderID int `json:"folderId"` TabID int `json:"tabId"` }
File represents a file in treeno
type FilesAddRequest ¶
type FilesAddRequest struct { }
FilesAddRequest TODO seems like it's not finished
type FilesAddResponse ¶
type FilesAddResponse struct { File File `json:"file"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
FilesAddResponse Response containing any errors and the file that was added
type FilesDownloadRequest ¶
type FilesDownloadRequest struct { Department string `json:"department"` Cabinet string `json:"cabinet"` FileIds []int `json:"fileIds"` Format string `json:"format"` // optional Filename string `json:"filename"` // optional }
FilesDownloadRequest request for file download
type FilesDownloadResponse ¶
type FilesDownloadResponse struct { DownloadFile FilesDownloadRequest `json:"downloadFile"` FileContent []byte `json:"fileContent"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
FilesDownloadResponse Response containing any errors, the file contents and the request
type FilesGetFilesInFolderResponse ¶
type FilesGetFilesInFolderResponse struct { Files FilesInFolder `json:"files"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
FilesGetFilesInFolderResponse Response containing any errors and the files in the folder
type FilesInFolder ¶
type FilesInFolder []struct { FileID int `json:"fileId"` Filename string `json:"filename"` Subfolder string `json:"subfolder"` }
FilesInFolder slice of filenames and ids
type FilesUploadToFolderRequest ¶
type FilesUploadToFolderRequest struct { Department string `json:"department"` CabinetID int `json:"cabinetId"` DocID int `json:"docId"` TabID int `json:"tabId,omitempty"` Filename string `json:"filename"` FileContent []byte `json:"fileContent"` }
FilesUploadToFolderRequest request for file upload
type FilesUploadToFolderResponse ¶
type FilesUploadToFolderResponse struct { Upload FilesUploadToFolderRequest `json:"upload"` FileID int `json:"fileId"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
FilesUploadToFolderResponse Response containing any errors and the initial request
type Folder ¶
type Folder struct { FolderID int `json:"folderId"` // optional CabinetID int `json:"cabinetId"` // optional, this or cabinet might be required Department string `json:"department"` Cabinet string `json:"cabinet"` // optional, this or cabinetId might be required Indices Indices `json:"indices"` }
Folder represents a folder in Treeno
func (*Folder) IndexValue ¶
IndexValue Find the value for a given index, or empty string
type FolderAddResponse ¶
type FolderAddResponse struct { Folder Folder `json:"folder"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
FolderAddResponse Response to add folder to cabinet
type FoldersResponse ¶
type FoldersResponse struct { Folders Folders `json:"folders"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
FoldersResponse GetFolders response
type IndexQuery ¶
type IndexQuery struct { Id int `json:"id,omitempty"` Index string `json:"index"` Value string `json:"value,omitempty"` Operator string `json:"operator,omitempty"` }
IndexQuery index query parameters
type StartWorkflowResponse ¶ added in v0.0.3
type StartWorkflowResponse struct { IsSuccess bool `json:"isSuccess"` Result StartWorkflowResult `json:"result"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
StartWorkflowResponse server response for starting a workflow
type StartWorkflowResult ¶ added in v0.0.3
type StartWorkflowResult struct { Success bool `json:"success"` ToDoUsers []string `json:"toDoUsers"` WfDocId int `json:"wfDocId"` NodeId int `json:"nodeId"` }
StartWorkflowResult results of starting a workflow
type TabInfoList ¶
type TabInfoList []struct { TabName string `json:"tabName"` FileName string `json:"fileName"` FileID int `json:"fileId"` DocID int `json:"docId"` FileSize int `json:"fileSize"` Department string `json:"department"` CabinetID int `json:"cabinetId"` }
TabInfoList slice of tabs
type TabInfoResponse ¶
type TabInfoResponse struct { TabInfoList TabInfoList `json:"tabInfoList"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
TabInfoResponse response of getSavedTabs
type TabRequest ¶
type TabRequest struct { TabName string `json:"tabName,"` FileName string `json:"fileName,"` FileID int `json:"fileId,"` DocID int `json:"docId,"` FileSize int `json:"fileSize,"` Department string `json:"department,"` CabinetID int `json:"cabinetId,"` }
TabRequest Request for list of tabs
type User ¶
type User struct { ID int `json:"id"` Username string `json:"username"` Password string `json:"password"` LdapID int `json:"ldapId"` Email string `json:"email"` }
User login acting user
type Workflow ¶ added in v0.0.3
type Workflow struct { Department string `json:"department"` Cabinet string `json:"cabinet"` DocId int `json:"docId"` FileId int `json:"fileId"` OwnerName string `json:"ownerName"` WfId int `json:"wfId"` Subfolder string `json:"subfolder,omitempty"` }
Workflow represents a treeno workflow
type WorkflowDefinition ¶ added in v0.0.5
type WorkflowDefinition struct { WorkflowId int `json:"workflowId"` WorkflowName string `json:"workflowName"` }
WorkflowDefinition Workflow id and description
type WorkflowDefinitionsResponse ¶ added in v0.0.5
type WorkflowDefinitionsResponse struct { WorkflowDefinitions []WorkflowDefinition `json:"workflowDefinitions"` HasError bool `json:"hasError"` ErrorMessage string `json:"errorMessage"` }
WorkflowDefinitionsResponse Response from getting definitions of workflows