Documentation
¶
Index ¶
- Constants
- Variables
- func ResponseBodyIfOK(resp *http.Response, err error) ([]byte, error)
- type AuthResp
- type Authentication
- type Bool
- type CabinetSearchFoldersResponse
- type CabinetSearchInfo
- type CabinetSearchResponse
- type CabinetSearchResult
- type Cabinets
- type CabinetsResponse
- type CheckIn
- type CheckInRequest
- type CheckInResponse
- type CheckOutFile
- type Client
- func (client *Client) AddFolder(f Folder) (folder Folder, err error)
- func (client *Client) DeleteFolder(folderToDelete FolderDeleteRequest) (response FolderDeleteResponse, err error)
- func (client *Client) Do(req *http.Request) (*http.Response, error)
- func (client *Client) EditFolder(request FolderEditRequest) (response FolderEditResponse, err 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) GetDetailedDocumentList(department string, cabinetId int, docId int) (dtr DetailedDocuments, 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) GetPersonalInboxInfo() (result PersonalInboxInfoResponse, 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) GetUserToDo(username string) (result GetToDoResponse, err error)
- func (client *Client) GetUserToDoWithContext(ctx context.Context, username string) (result GetToDoResponse, 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) NewAuthRequestWithContext(ctx context.Context, 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) SearchCabinetFolders(cabinet string, query ...IndexQuery) (results CabinetSearchInfo, err error)
- func (client *Client) SearchCabinetWithContext(ctx context.Context, cabinet string, query ...IndexQuery) (results []CabinetSearchResult, err error)
- func (client *Client) StartWorkflow(w Workflow) (result StartWorkflowResponse, err error)
- func (client *Client) VersionsFileCheckIn(request CheckInRequest) (response CheckInResponse, err error)
- func (client *Client) VersionsFileCheckOut(request VersionFileCheckOutRequest) (response VersionFileCheckOutResponse, err error)
- type Config
- type Date
- type DateTime
- type DepartmentResponse
- type Departments
- type DetailedDocumentListResponse
- type DetailedDocuments
- 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 FolderDeleteRequest
- type FolderDeleteResponse
- type FolderEditRequest
- type FolderEditResponse
- type Folders
- type FoldersResponse
- type GetToDoResponse
- type Index
- type IndexQuery
- type Indices
- type PersonalInboxInfo
- type PersonalInboxInfoResponse
- type StartWorkflowResponse
- type StartWorkflowResult
- type TabInfoList
- type TabInfoResponse
- type TabRequest
- type ToDoItem
- type ToDoList
- type User
- type VersionFileCheckOutRequest
- type VersionFileCheckOutResponse
- type Workflow
- type WorkflowDefinition
- type WorkflowDefinitionsResponse
Constants ¶
const DateFormat = "01/02/2006"
DateFormat format used by docuphase
const DateTimeFormat = "2006-01-02T15:04:05"
Variables ¶
var ErrNotImplemented = fmt.Errorf("not implemented")
ErrNotImplemented this method isn't implemented yet
var ErrNotOK = fmt.Errorf("Status Not OK")
Functions ¶
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 docuphaseTime `json:"expiration"`
}
Authentication Auth info
type Bool ¶
type Bool bool
Bool docuphase representation of a bool, like "True", "Yes", etc.
func (*Bool) MarshalJSON ¶
MarshalJSON Marshall to valid docuphase date
func (*Bool) UnmarshalJSON ¶
UnmarshalJSON Unmarshall from docuphase some kind of positive representation to go bool
type CabinetSearchFoldersResponse ¶
type CabinetSearchFoldersResponse struct {
CabinetSearchInfo CabinetSearchInfo `json:"CabinetSearchInfo"`
HasError bool `json:"HasError"`
ErrorMessage string `json:"errorMessage"`
}
type CabinetSearchInfo ¶
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 CheckInRequest ¶ added in v0.0.12
type CheckInRequest CheckIn
CheckInRequest request for file upload
type CheckInResponse ¶ added in v0.0.12
type CheckInResponse struct {
HasError bool `json:"HasError"`
ErrorMessage string `json:"ErrorMessage"`
Data string `json:"Data"`
CheckIn CheckIn `json:"CheckIn"`
}
CheckInResponse Response containing any errors and the initial request
type CheckOutFile ¶ added in v0.0.12
type Client ¶
type Client struct {
Authentication Authentication
DefaultDepartment string
// contains filtered or unexported fields
}
Client docuphase 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) DeleteFolder ¶
func (client *Client) DeleteFolder(folderToDelete FolderDeleteRequest) (response FolderDeleteResponse, err error)
DeleteFolder delete a folder from a cabinet
func (*Client) EditFolder ¶
func (client *Client) EditFolder(request FolderEditRequest) (response FolderEditResponse, err error)
EditFolder edits a folder in the thing
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) GetDetailedDocumentList ¶ added in v0.0.16
func (client *Client) GetDetailedDocumentList(department string, cabinetId int, docId int) (dtr DetailedDocuments, err error)
GetDetailedDocumentList gets a list of documents in a folder TODO untested
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) GetPersonalInboxInfo ¶
func (client *Client) GetPersonalInboxInfo() (result PersonalInboxInfoResponse, err error)
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) GetUserToDo ¶ added in v0.0.14
func (client *Client) GetUserToDo(username string) (result GetToDoResponse, err error)
GetUserToDo gets the to do items for a username
func (*Client) GetUserToDoWithContext ¶ added in v0.0.15
func (client *Client) GetUserToDoWithContext(ctx context.Context, username string) (result GetToDoResponse, err error)
GetUserToDoWithContext gets the to do items for a username
func (*Client) GetWorkflowDefinitions ¶
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) NewAuthRequestWithContext ¶ added in v0.0.15
func (client *Client) NewAuthRequestWithContext(ctx context.Context, path string, method string, body io.Reader) (req *http.Request, err error)
NewAuthRequestWithContext with auth header and body and context
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) SearchCabinetFolders ¶
func (client *Client) SearchCabinetFolders(cabinet string, query ...IndexQuery) (results CabinetSearchInfo, err error)
SearchCabinetFolders Searches cabinet for folders by index value. Returns only Folder IDs Gotcha: Cabinet index names are all lower case for some reason
func (*Client) SearchCabinetWithContext ¶ added in v0.0.15
func (client *Client) SearchCabinetWithContext(ctx context.Context, cabinet string, query ...IndexQuery) (results []CabinetSearchResult, err error)
SearchCabinetWithContext Searches cabinet for folders by index value Gotcha: Cabinet index names are all lower case for some reason
func (*Client) StartWorkflow ¶
func (client *Client) StartWorkflow(w Workflow) (result StartWorkflowResponse, err error)
StartWorkflow from a workflow request
func (*Client) VersionsFileCheckIn ¶ added in v0.0.12
func (client *Client) VersionsFileCheckIn(request CheckInRequest) (response CheckInResponse, err error)
VersionsFileCheckIn Check In a file I guess
func (*Client) VersionsFileCheckOut ¶ added in v0.0.12
func (client *Client) VersionsFileCheckOut(request VersionFileCheckOutRequest) (response VersionFileCheckOutResponse, err error)
VersionsFileCheckOut check out a file
type Config ¶
Config Configs required to create a client
func (*Config) Authenticate ¶
func (conf *Config) Authenticate() (*Authentication, error)
Authenticate authenticates to the docuphase API
type Date ¶
Date Valid docuphase date
func (*Date) MarshalJSON ¶
MarshalJSON Marshall to valid docuphase date
func (*Date) UnmarshalJSON ¶
UnmarshalJSON Unmarshall from docuphase time to go time
type DateTime ¶ added in v0.0.16
func (*DateTime) MarshalJSON ¶ added in v0.0.16
MarshalJSON Marshall to valid docuphase date
func (*DateTime) UnmarshalJSON ¶ added in v0.0.16
UnmarshalJSON Unmarshall from docuphase time to go time
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 docuphase
type DetailedDocumentListResponse ¶ added in v0.0.16
type DetailedDocumentListResponse struct {
HasError bool `json:"hasError"`
ErrorMessage string `json:"errorMessage"`
DetailedDocuments DetailedDocuments `json:"detailedDocuments"`
}
DetailedDocumentListResponse probably gives back document types for a folder
type DetailedDocuments ¶ added in v0.0.16
type DetailedDocuments []struct {
Sequence int `json:"sequence"`
DocumentName string `json:"documentName"`
DocumentType string `json:"documentType"`
TabId int `json:"tabId"`
Indices []struct {
IndexName string `json:"indexName"`
Display string `json:"display"`
Value string `json:"value"`
} `json:"indices"`
}
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 docuphase
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"`
Location string `json:"location"`
Subfolder string `json:"subfolder"`
CreatedBy string `json:"createdBy"`
CreationDate DateTime `json:"creationDate"`
FileSize int `json:"fileSize"`
Ordering int `json:"ordering"`
}
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 docuphase
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 FolderDeleteRequest ¶
type FolderDeleteResponse ¶
type FolderDeleteResponse struct {
Folder FolderDeleteRequest `json:"folder"`
HasError bool `json:"hasError"`
ErrorMessage string `json:"errorMessage"`
}
type FolderEditRequest ¶
type FolderEditResponse ¶
type FolderEditResponse struct {
HasError bool `json:"HasError"`
ErrorMessage string `json:"ErrorMessage"`
IsSuccess bool `json:"IsSuccess"`
Folder struct {
DocId int `json:"DocId"`
Department string `json:"Department"`
Cabinet string `json:"Cabinet"`
Indices []struct {
Index string `json:"Index"`
Value string `json:"Value"`
} `json:"Indices"`
} `json:"Folder"`
}
type FoldersResponse ¶
type FoldersResponse struct {
Folders Folders `json:"folders"`
HasError bool `json:"hasError"`
ErrorMessage string `json:"errorMessage"`
}
FoldersResponse GetFolders response
type GetToDoResponse ¶ added in v0.0.14
type GetToDoResponse struct {
ToDoList ToDoList `json:"toDoList"`
HasError bool `json:"hasError"`
ErrorMessage string `json:"errorMessage"`
}
GetToDoResponse response from server for to do items for user
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 for querying cabinets Available operators contains endswith startswith isblank < <= > >= equalto
type Indices ¶
type Indices []Index
Indices slice of indexes
type PersonalInboxInfo ¶
type PersonalInboxInfoResponse ¶
type PersonalInboxInfoResponse struct {
Info []PersonalInboxInfo `json:"info"`
HasError bool `json:"hasError"`
ErrorMessage string `json:"errorMessage"`
}
type StartWorkflowResponse ¶
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 ¶
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 ToDoItem ¶ added in v0.0.14
type ToDoItem struct {
Id int `json:"id"`
Department string `json:"department"`
Cabinet string `json:"cabinet"`
DocId int `json:"docId"`
FileId int `json:"fileId"`
WorkflowNodeId int `json:"workflowNodeId"`
Username string `json:"username"`
WorkflowDefId int `json:"workflowDefId"`
WorkflowDocumentId int `json:"workflowDocumentId"`
Priority int `json:"priority"`
Notes string `json:"notes,omitempty"`
Date string `json:"date"`
DelegatedFrom string `json:"delegatedFrom,omitempty"`
}
ToDoItem an individual to do item
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 VersionFileCheckOutRequest ¶ added in v0.0.12
type VersionFileCheckOutRequest CheckOutFile
type VersionFileCheckOutResponse ¶ added in v0.0.12
type VersionFileCheckOutResponse struct {
HasError bool `json:"HasError"`
ErrorMessage string `json:"ErrorMessage"`
Content []byte `json:"Content"`
CheckOutFile CheckOutFile `json:"CheckOutFile"`
}
type Workflow ¶
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 docuphase workflow
type WorkflowDefinition ¶
type WorkflowDefinition struct {
WorkflowId int `json:"workflowId"`
WorkflowName string `json:"workflowName"`
}
WorkflowDefinition Workflow id and description
type WorkflowDefinitionsResponse ¶
type WorkflowDefinitionsResponse struct {
WorkflowDefinitions []WorkflowDefinition `json:"workflowDefinitions"`
HasError bool `json:"hasError"`
ErrorMessage string `json:"errorMessage"`
}
WorkflowDefinitionsResponse Response from getting definitions of workflows