Documentation ¶
Index ¶
- func AttachAcronym(r *mux.Router)
- func AttachDir(r *mux.Router)
- func AttachFile(r *mux.Router)
- func AttachGroup(r *mux.Router)
- func AttachNLP(r *mux.Router)
- func AttachOwner(r *mux.Router)
- func AttachPerm(r *mux.Router)
- func AttachPublic(r *mux.Router)
- func AttachRecord(r *mux.Router)
- func AttachSearch(r *mux.Router)
- func AttachUser(r *mux.Router)
- func ConnectDatabase(next http.Handler) http.Handler
- func Logging(next http.Handler) http.Handler
- func ParseBody(next http.Handler) http.Handler
- func Recovery(next http.Handler) http.Handler
- func Timeout(next http.Handler) http.Handler
- func UserCookie(next http.Handler) http.Handler
- type CompletePackage
- type ContextKey
- type DirInformation
- type FileContent
- type FileInfo
- type GroupInformation
- type ResWrtrCapturer
- type SearchResponse
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachAcronym ¶
AttachAcronym is to add api paths related to acronyms
func AttachGroup ¶
AttachGroup adds api paths related to group actions
func AttachNLP ¶
AttachNLP adds route to router for getting nlp data generated by the processing system
func AttachOwner ¶
AttachOwner adds api paths related to owner actions
func AttachPerm ¶
AttachPerm is for paths related to permission actions
func AttachPublic ¶
AttachPublic is for searching public available files
func AttachRecord ¶
AttachRecord adds paths for basic file actions TODO: combine with AttachFile
func AttachSearch ¶
AttachSearch adds handlers for searching the tags of files
func AttachUser ¶
AttachUser hooks up paths for handling user related requests
func ConnectDatabase ¶
ConnectDatabase is a middleware the opens a connection to the database and populates the request context with connection objects
func ParseBody ¶
ParseBody parses request's body allows for requests to be formed as json or normal request forms
Types ¶
type CompletePackage ¶
type CompletePackage struct { User userProfile `json:"user"` Public publicProfile `json:"public"` Groups map[string]groupProfile `json:"groups"` Records map[string]fileProfile `json:"files"` }
CompletePackage is a full set of metadata relating to a particular user
type ContextKey ¶
type ContextKey byte
ContextKey type used to map in values into request context
const ( // USER is for the currect user USER ContextKey = iota // GROUP is for the group the handler is meant to operate on or with GROUP )
type DirInformation ¶
DirInformation is the json encoding for folder information
type FileContent ¶
type FileContent struct { Length int `json:"size"` Vals []types.ContentLine `json:"lines"` }
FileContent is the json encoding for lines from a file
type FileInfo ¶
type FileInfo struct { File types.FileI `json:"file"` Count int64 `json:"count,omitempty"` //sentence count Size int64 `json:"size,omitempty"` //size of original file in bytes }
FileInfo json response type of file information
type GroupInformation ¶
type GroupInformation struct { ID string `json:"id"` Name string `json:"name"` Owner string `json:"owner"` Members []string `json:"members,omitempty"` }
GroupInformation is the json encoding object for Groups
func BuildGroupInfo ¶
func BuildGroupInfo(grp types.GroupI) GroupInformation
BuildGroupInfo contructs Group Response Object from Group
type ResWrtrCapturer ¶
type ResWrtrCapturer struct { StatusCode int // contains filtered or unexported fields }
ResWrtrCapturer http.ResponseWriter that saves status code
func (*ResWrtrCapturer) Header ¶
func (rwc *ResWrtrCapturer) Header() http.Header
Header implements http.ResponseWriter
func (*ResWrtrCapturer) Write ¶
func (rwc *ResWrtrCapturer) Write(b []byte) (int, error)
Write implements http.ResponseWriter
func (*ResWrtrCapturer) WriteHeader ¶
func (rwc *ResWrtrCapturer) WriteHeader(sc int)
WriteHeader implements http.ResponseWriter
type SearchResponse ¶
type SearchResponse struct {
Files []FileInfo `json:"matched"`
}
SearchResponse json response of matched files to a search
func BuildSearchResponse ¶
func BuildSearchResponse(r *http.Request, fids []types.FileID) SearchResponse
BuildSearchResponse contructs SearchResponse from a list of matched fileids