Back to godoc.org
bitbucket.org/olympiaschooldistrict/treeno

Package treeno

v0.0.0-...-64ec288
Latest Go to latest

The highest tagged major version is .

Published: May 15, 2020 | License: MIT | Module: bitbucket.org/olympiaschooldistrict/treeno

Index

type AuthResp

type AuthResp struct {
	Authentication Authentication `json:"authentication"`
	HasError       bool           `json:"hasError"`
	ErrorMessage   string         `json:"errorMessage"`
}

authentication response

type Authentication

type Authentication struct {
	User         User      `json:"user"`
	Token        string    `json:"token"`
	RefreshToken string    `json:"refreshToken"`
	Expiration   time.Time `json:"expiration"`
}

authentication

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"`
}

type CabinetsResponse

type CabinetsResponse struct {
	Cabinets     Cabinets `json:"cabinets"`
	HasError     bool     `json:"hasError"`
	ErrorMessage string   `json:"errorMessage"`
}

type Client

type Client struct {
	Authentication Authentication

	DefaultDepartment string
	// contains filtered or unexported fields
}

client

func NewService

func NewService(conf Config) (client Client, err error)

Make a new client with provided config

func (*Client) AddFolder

func (client *Client) AddFolder(f Folder) (folder Folder, err error)

Add a folder

func (*Client) FilesAdd

func (client *Client) FilesAdd(file FilesAddRequest) (err error)

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)

TODO NOT TESTED

func (*Client) FilesGetFilesInFolder

func (client *Client) FilesGetFilesInFolder(department string, cabinet string, folderId int) (files FilesInFolder, err error)

TODO NOT TESTED department real name cabinet real name

func (*Client) FilesUploadToFolder

func (client *Client) FilesUploadToFolder(file FilesUploadToFolderRequest) (fileId int, err error)

Upload a file to a folder

func (*Client) GetDepartments

func (client *Client) GetDepartments() (deps Departments, err error)

func (*Client) GetDocumentTypes

func (client *Client) GetDocumentTypes(department string, cabinet string) (dTypes DocumentTypes, err error)

UNTESTED Get a list of document types for a cabinet in a department

func (*Client) GetFolders

func (client *Client) GetFolders(department string, cabinet string) (f Folders, err error)

return list of folders in a cabinet

func (*Client) GetSavedTabs

func (client *Client) GetSavedTabs(department string, cabinet string) (f TabInfoList, err error)

Gets list of saved tabs name for a cabinet

func (*Client) GetTabInfo

func (client *Client) GetTabInfo(department string, cabinet string, folder string) (f TabInfoList, err error)

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) ListCabinets

func (client *Client) ListCabinets(department string) (cabinets Cabinets, err error)

Returns a list of cabinets in a department

func (Client) NewAuthRequest

func (client Client) NewAuthRequest(url string, method string, body *bytes.Buffer) (req *http.Request, err error)

NewAuthRequest with auth header and body

func (Client) Renew

func (client Client) Renew()

TODO App engine instances don't live very long, this could be implemented later if we need to

type Config

type Config struct {
	Host     string
	Username string
	Email    string
	Password string
}

type DepartmentResponse

type DepartmentResponse struct {
	Departments  Departments `json:"departments"`
	HasError     bool        `json:"hasError"`
	ErrorMessage string      `json:"errorMessage"`
}

type Departments

type Departments []struct {
	RealName string `json:"realName"`
	ArbName  string `json:"arbName"`
}

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"`
}

type DocumentTypesResponse

type DocumentTypesResponse struct {
	DocumentTypes DocumentTypes `json:"documentTypes"`
	HasError      bool          `json:"hasError"`
	ErrorMessage  string        `json:"errorMessage"`
}

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"`
}

type FilesAddRequest

type FilesAddRequest struct {
}

type FilesAddResponse

type FilesAddResponse struct {
	File         File   `json:"file"`
	HasError     bool   `json:"hasError"`
	ErrorMessage string `json:"errorMessage"`
}

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
}

type FilesDownloadResponse

type FilesDownloadResponse struct {
	DownloadFile FilesDownloadRequest `json:"downloadFile"`
	FileContent  []byte               `json:"fileContent"`
	HasError     bool                 `json:"hasError"`
	ErrorMessage string               `json:"errorMessage"`
}

type FilesGetFilesInFolderResponse

type FilesGetFilesInFolderResponse struct {
	Files        FilesInFolder `json:"files"`
	HasError     bool          `json:"hasError"`
	ErrorMessage string        `json:"errorMessage"`
}

type FilesInFolder

type FilesInFolder []struct {
	FileID    int    `json:"fileId"`
	Filename  string `json:"filename"`
	Subfolder string `json:"subfolder"`
}

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"`
}

type FilesUploadToFolderResponse

type FilesUploadToFolderResponse struct {
	Upload       FilesUploadToFolderRequest `json:"upload"`
	FileID       int                        `json:"fileId"`
	HasError     bool                       `json:"hasError"`
	ErrorMessage string                     `json:"errorMessage"`
}

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

func (*Folder) IndexValue

func (f *Folder) IndexValue(index string) (value string)

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"`
}

Request to add folder to cabinet

type Folders

type Folders []Folder

slice of folders

type FoldersResponse

type FoldersResponse struct {
	Folders      Folders `json:"folders"`
	HasError     bool    `json:"hasError"`
	ErrorMessage string  `json:"errorMessage"`
}

response

type Indices

type Indices []struct {
	Index string `json:"index"`
	Value string `json:"value"` //optional?
}

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"`
}

type TabInfoResponse

type TabInfoResponse struct {
	TabInfoList  TabInfoList `json:"tabInfoList"`
	HasError     bool        `json:"hasError"`
	ErrorMessage string      `json:"errorMessage"`
}

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,"`
}

type User

type User struct {
	ID       int    `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
	LdapID   int    `json:"ldapId"`
	ExpTime  string `json:"expTime"`
	Email    string `json:"email"`
}

login user

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier