{"modulePath":"github.com/CHESSComputing/Frontend","version":"v0.4.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package main\n\n## Variables\n\n```go\nvar DEFAULT_END_POINT string\n```\n\n```go\nvar LicenseMap = map[string]LicenseInfo{\n\t\"CC-BY-4.0\": {\n\t\tName: \"Creative Commons Attribution 4.0 International\",\n\t\tURI:  \"https://creativecommons.org/licenses/by/4.0/\",\n\t},\n\t\"CC0-1.0\": {\n\t\tName: \"Creative Commons Zero 1.0 Universal\",\n\t\tURI:  \"https://creativecommons.org/publicdomain/zero/1.0/\",\n\t},\n\t\"CC-BY-SA-4.0\": {\n\t\tName: \"Creative Commons Attribution-ShareAlike 4.0 International\",\n\t\tURI:  \"https://creativecommons.org/licenses/by-sa/4.0/\",\n\t},\n\t\"CC-BY-NC-4.0\": {\n\t\tName: \"Creative Commons Attribution-NonCommercial 4.0 International\",\n\t\tURI:  \"https://creativecommons.org/licenses/by-nc/4.0/\",\n\t},\n\t\"CC-BY-ND-4.0\": {\n\t\tName: \"Creative Commons Attribution-NoDerivatives 4.0 International\",\n\t\tURI:  \"https://creativecommons.org/licenses/by-nd/4.0/\",\n\t},\n\t\"ODC-By-1.0\": {\n\t\tName: \"Open Data Commons Attribution License\",\n\t\tURI:  \"https://opendatacommons.org/licenses/by/1-0/\",\n\t},\n\t\"ODbL-1.0\": {\n\t\tName: \"Open Database License\",\n\t\tURI:  \"https://opendatacommons.org/licenses/odbl/1-0/\",\n\t},\n\t\"PDDL-1.0\": {\n\t\tName: \"Public Domain Dedication and License\",\n\t\tURI:  \"https://opendatacommons.org/licenses/pddl/1-0/\",\n\t},\n}\n```\n\n```go\nvar StaticFs embed.FS\n```\ncontent is our static web server content.\n\n```go\nvar Verbose int\n```\n\n## Functions\n\n```go\nfunc AIChatHandler(c *gin.Context)\n```\nAIChatHandler handles requests from AI assitance chat\n\n```go\nfunc AIMLHandler(c *gin.Context)\n```\nAIMLHandler provides access to GET /aiml endpoint\n\n```go\nfunc AddAuxDataHandler(c *gin.Context)\n```\nAddAuxDataHandler provides access to POST /addauxdata endpoint\n\n```go\nfunc AdvancedSearchHandler(c *gin.Context)\n```\nAdvancedSearchHandler provides access to GET /search endpoint\n\n```go\nfunc AmendFormHandler(c *gin.Context)\n```\nAmendFormHandler provides access to GET /amend endpoint\n\n```go\nfunc AmendRecordHandler(c *gin.Context)\n```\nAmendRecordHandler provides access to POST /amend endpoint\n\n```go\nfunc AnalysisHandler(c *gin.Context)\n```\nAnalysisHandler provides access to GET /analysis endpoint\n\n```go\nfunc ChildrenHandler(c *gin.Context)\n```\nChildrenHandler provides access to GET /children endpoint the endpoint supports did=\\\u003cdid\u003e and recursive=\\\u003ctrue\u003e options (to find all children through recursive iteration across all recrods)\n\n```go\nfunc DMFilesHandler(c *gin.Context)\n```\nDMFiles provides access to GET /dm end-point\n\n```go\nfunc DataHandler(c *gin.Context)\n```\nDataHandler provides access to GET /data endpoint\n\n```go\nfunc DataHubHandler(c *gin.Context)\n```\nDataHubHandler provides access to GET /datahub end-point\n\n```go\nfunc DataManagementHandler(c *gin.Context)\n```\nDataManagementHandler provides access to GET /dm end-point\n\n```go\nfunc DataManagementInfoHandler(c *gin.Context)\n```\nDataManagementInfoHandler provides access to GET /info/datamanagement endpoint\n\n```go\nfunc DatasetsHandler(c *gin.Context)\n```\nDatasetsHandler provides access to GET /datasets endpoint\n\n```go\nfunc DatasetsTableHandler(c *gin.Context)\n```\nDatasetsTableHandler provides access to GET /dstable endpoint\n\n```go\nfunc DidsHandler(c *gin.Context)\n```\nDidsHandler provides access to GET /dids endpoint\n\n```go\nfunc DocsHandler(c *gin.Context)\n```\nDocsHandler provides access to GET /docs end-point\n\n```go\nfunc DocsLocalHandler(c *gin.Context)\n```\nDocsLocalHandler provides access to GET /docs end-point\n\n```go\nfunc DoiPublicHandler(c *gin.Context)\n```\nDoiPublicHandler handles publishing given DOI as public record\n\n```go\nfunc ElapsedTime(createdAt, updatedAt string) (time.Duration, error)\n```\nElapsedTime returns the duration between createdAt and updatedAt\n\n```go\nfunc FacebookCallBackHandler(c *gin.Context)\n```\nFacebookCallBackHandler provides kerberos authentication handler\n\n```go\nfunc FacebookOauthLoginHandler(c *gin.Context)\n```\nFacebookOauthLoginHandler provides kerberos authentication handler\n\n```go\nfunc FilterKeys(record map[string]any, skip []string) map[string]any\n```\n\n```go\nfunc GithubCallBackHandler(c *gin.Context)\n```\nGithubCallBackHandler provides kerberos authentication handler\n\n```go\nfunc GithubOauthLoginHandler(c *gin.Context)\n```\nGithubOauthLoginHandler provides kerberos authentication handler\n\n```go\nfunc GonexusValidateHandler(c *gin.Context)\n```\nGonexusValidateHandler provides access to POST /notesform endpoint\n\n```go\nfunc GoogleCallBackHandler(c *gin.Context)\n```\nGoogleCallBackHandler provides kerberos authentication handler\n\n```go\nfunc GoogleOauthLoginHandler(c *gin.Context)\n```\nGoogleOauthLoginHandler provides kerberos authentication handler\n\n```go\nfunc IsComposite(v any) bool\n```\n\n```go\nfunc KAuthHandler(c *gin.Context)\n```\nKAuthHandler provides kerberos authentication handler\n\n```go\nfunc LoginHandler(c *gin.Context)\n```\nLoginHandler provides access to GET /login endpoint\n\n```go\nfunc LogoutHandler(c *gin.Context)\n```\nLogoutHandler provides access to GET /logout endpoint\n\n```go\nfunc MainHandler(c *gin.Context)\n```\nMainHandler provides access to GET / end-point\n\n```go\nfunc MetaDataHandler(c *gin.Context)\n```\nMetaDataHandler provides access to GET /meta endpoint\n\n```go\nfunc MetaFileUploadHandler(c *gin.Context)\n```\nMetaFileUploadHandler provides access to GET /meta/file/upload endpoint\n\n```go\nfunc MetaFormUploadHandler(c *gin.Context)\n```\nMetaFormUploadHandler provides access to GET /meta/form/upload endpoint\n\n```go\nfunc MetaTmplSubmitHandler(c *gin.Context)\n```\nMetaTmplSubmitHandler provides access to POST /meta/tmpl/submit endpoint\n\n```go\nfunc MetaTmplUploadHandler(c *gin.Context)\n```\nMetaTmplUploadHandler provides access to POST /meta/tmpl/upload endpoint\n\n```go\nfunc MetaUploadHandler(c *gin.Context, mrec services.MetaRecord, updateMetadata bool)\n```\nMetaUploadHandler manages upload of record to MetaData service\n\n```go\nfunc NotImplementedHandler(c *gin.Context)\n```\nNotImplementedHandler provides access to GET /login endpoint\n\n```go\nfunc NotebookHandler(c *gin.Context)\n```\nNotebookHandler provides access to GET /notebook endpoint\n\n```go\nfunc NotesFormHandler(c *gin.Context)\n```\nNotesFormHandler provides access to POST /notesform endpoint\n\n```go\nfunc NotesHandler(c *gin.Context)\n```\nNotesHandler provides access to POST /notesform endpoint\n\n```go\nfunc ParentsHandler(c *gin.Context)\n```\nParentsHandler provides access to GET /parents endpoint the endpoint supports did=\\\u003cdid\u003e and recursive=\\\u003ctrue\u003e options (to find all parents through recursive iteration across all recrods)\n\n```go\nfunc PostProvenanceHandler(c *gin.Context)\n```\nPostProvenanceHandler provides access to GET /provenance endpoint\n\n```go\nfunc PostRecordHandler(c *gin.Context)\n```\nPostRecordHandler provides access to POST /record endpoint\n\n```go\nfunc ProvInfoHandler(c *gin.Context)\n```\nProvInfoHandler provides access to GET /info/provenance endpoint\n\n```go\nfunc ProvenanceHandler(c *gin.Context)\n```\nProvenanceHandler provides access to GET /provenance endpoint\n\n```go\nfunc PublishFormHandler(c *gin.Context)\n```\nPublishFormHandler handles publish request for did\n\n```go\nfunc PublishHandler(c *gin.Context)\n```\nPOST handlers PublishHandler handles publish request for did\n\n```go\nfunc PublishSrvHandler(c *gin.Context)\n```\nPublishSrvHandler provides access to GET /piublish endpoint\n\n```go\nfunc RecordHandler(c *gin.Context)\n```\nRecordHandler provides access to GET /search endpoint\n\n```go\nfunc RecordsGraphHandler(c *gin.Context)\n```\nRecordsGraphHandler provides access to GET /graph endpoint\n\n```go\nfunc SchemasHandler(c *gin.Context)\n```\nSchemasHandler provides access to GET /schemas end-point\n\n```go\nfunc SearchHandler(c *gin.Context)\n```\nSearchHandler provides access to GET /search endpoint\n\n```go\nfunc Server()\n```\nServer defines our HTTP server\n\n```go\nfunc ServicesHandler(c *gin.Context)\n```\nServicesHandler provides access to GET / end-point\n\n```go\nfunc SpecScansDataHandler(c *gin.Context)\n```\nSpecScansDataHandler provides access to GET /specscans/data endpoint. Returns a JSON payload of SpecScan records with optional server-side filtering, sorting, and pagination. With ?did=xxx: returns records for that DID. Without ?did: returns records filtered by the user's BTR groups.\n\n```go\nfunc SpecScansHandler(c *gin.Context)\n```\nSpecScansHandler provides access to GET /specscans endpoint. With ?did=xxx: shows a DataTable of SpecScan records for that DID. Without ?did: shows a DataTable of all SpecScan records matching the user's BTR groups.\n\n```go\nfunc SpecScansInfoHandler(c *gin.Context)\n```\nSpecScansInfoHandler provides access to GET /info/scanspecs endpoint\n\n```go\nfunc Stringify(v any) string\n```\n\n```go\nfunc SyncDeleteHandler(c *gin.Context)\n```\nSyncDeleteHandler provides access to DELETE /sync/delete/:uuid endpoint\n\n```go\nfunc SyncFormHandler(c *gin.Context)\n```\nSyncFormHandler provides access to POST /sync endpoint\n\n```go\nfunc SyncHandler(c *gin.Context)\n```\nSyncHandler provides access to GET /sync endpoint\n\n```go\nfunc SyncStatusHandler(c *gin.Context)\n```\nSyncStatusHandler provides access to GET /sync/status/:uuid endpoint\n\n```go\nfunc TmplRecordCreateHandler(c *gin.Context)\n```\nTmplRecordCreateHandler handles creation of tmpl record\n\n```go\nfunc TmplRecordDeleteHandler(c *gin.Context)\n```\nTmplRecordDeleteHandler handles updates of tmpl record\n\n```go\nfunc TmplRecordHandler(c *gin.Context, action string)\n```\nTmplRecordHandler handles updates of tmp records\n\n```go\nfunc TmplRecordUpdateHandler(c *gin.Context)\n```\nTmplRecordUpdateHandler handles updates of tmpl record\n\n```go\nfunc TmplRecordValidateHandler(c *gin.Context)\n```\nTmplRecordValidateHandler handles creation of tmpl record\n\n```go\nfunc TmplRecordsFormHandler(c *gin.Context)\n```\nTmplRecordsFormHandler provides access to POST /notesform endpoint\n\n```go\nfunc TokenHandler(c *gin.Context)\n```\nTokenHandler provides access to GET /token endpoint\n\n```go\nfunc ToolsHandler(c *gin.Context)\n```\nToolsHandler provides access to GET /tools endpoint\n\n```go\nfunc UploadJSONHandler(c *gin.Context)\n```\nUploadJSONHandler handles upload of JSON record\n\n```go\nfunc UserUploadHandler(c *gin.Context, mrec services.MetaRecord, updateMetadata bool)\n```\nUserUploadHandler manages upload of user record to Metadata service\n\n```go\nfunc UsersHandler(c *gin.Context)\n```\nUsersHandler provides access to GET /users endpoint\n\n```go\nfunc VisualizationHandler(c *gin.Context)\n```\nVisualizationHandler provides access to GET /visualization endpoint\n\n## Types\n\n```go\ntype AIChat interface {\n\tChat(user, prompt string) (string, error)\n}\n```\nAIChat represents generic AI chat interface\n\n```go\ntype AffiliationInfo struct {\n\tAffiliation string `json:\"affiliation\"`\n}\n```\n\n```go\ntype ChatRequest struct {\n\tMessage string `json:\"message\"`\n}\n```\nChatRequest represents incoming JSON from frontend\n\n```go\ntype ChatResponse struct {\n\tReply string `json:\"reply\"`\n}\n```\nChatResponse represents outgoing JSON to frontend\n\n```go\ntype DocsParams struct {\n\tPage string `uri:\"page\" binding:\"required\"`\n}\n```\nDocsParams represents URI storage params in /docs/:page end-point\n\n```go\ntype ELogEntry struct {\n\tDid      string    `json:\"did,omitempty\"`\n\tText     string    `json:\"text\"`\n\tUser     string    `json:\"user\"`\n\tDidHash  string    `json:\"didhash,omitempty\"`\n\tImageURL string    `json:\"image_url,omitempty\"`\n\tDate     time.Time `json:\"date\"`\n}\n```\nELogEntry defines Elog entry structure\n\n```go\ntype EdgeData struct {\n\tID      string `json:\"id\"`\n\tSource  string `json:\"source\"`\n\tTarget  string `json:\"target\"`\n\tProv    bool   `json:\"prov,omitempty\"`\n\tProvDid string `json:\"provDid,omitempty\"`\n}\n```\n\n```go\ntype GonexusRecord struct {\n\tUser  string   `json:\"user\"`\n\tScope string   `json:\"scope\"`\n\tBtrs  []string `json:\"btrs\"`\n\tDid   string   `json:\"did\"`\n\tFile  string   `json:\"file\"`\n}\n```\nGonexusRecord represents request from gonexus server\n\n```go\ntype GraphEdge struct {\n\tData EdgeData `json:\"data\"`\n}\n```\n\n```go\ntype GraphElements struct {\n\tNodes []GraphNode `json:\"nodes\"`\n\tEdges []GraphEdge `json:\"edges\"`\n}\n```\n\n```go\ntype GraphNode struct {\n\tData NodeData `json:\"data\"`\n}\n```\n\n```go\ntype LicenseInfo struct {\n\tName string\n\tURI  string\n}\n```\n\n```go\ntype MetaParams struct {\n\tDID string `form:\"did\"`\n}\n```\nMetaParams represents /record?did=bla end-point\n\n```go\ntype NodeData struct {\n\tID      string         `json:\"id\"`\n\tLabel   string         `json:\"label\"`\n\tGroup   string         `json:\"group\"`   // drives color-coding (schema name)\n\tDetails map[string]any `json:\"details\"` // full record, shown on click\n}\n```\n\n```go\ntype NoteEntry struct {\n\tDid  string `json:\"did\"`\n\tText string `json:\"text\"`\n\tUser string `json:\"user\"`\n\tDate uint64 `json:\"date\"`\n}\n```\nNoteEntry defines Elog entry structure\n\n```go\ntype OllamaClient struct {\n\tAIConfig *ollama.Config\n}\n```\nOllamaClient represents Ollama AI client\n\n```go\nfunc (o *OllamaClient) Chat(user, prompt string) (string, error)\n```\nChat implementation for OllamaClient\n\n```go\ntype TichyClient struct{}\n```\nTichyClient represents the tichy AI client. It fans out requests concurrently across all configured VectorDB collections and aggregates the results into a single response.\n\n```go\nfunc (o *TichyClient) Chat(user, prompt string) (string, error)\n```\nChat sends the prompt to every configured collection concurrently and returns a merged response. When no collections are configured the request falls back to the server default.\n\n```go\ntype TichyMessage struct {\n\tRole    string `json:\"role\"`\n\tContent string `json:\"content\"`\n}\n```\nTichyMessage is a single chat message sent to the tichy server.\n\n```go\ntype TichyRequest struct {\n\tMessages []TichyMessage `json:\"messages\"`\n}\n```\nTichyRequest is the JSON body sent to /v1/chat/completions.\n\n```go\ntype TichyResponse struct {\n\tChoices []struct {\n\t\tIndex        int    `json:\"index\"`\n\t\tFinishReason string `json:\"finish_reason\"`\n\t\tMessage      struct {\n\t\t\tRole    string `json:\"role\"`\n\t\t\tContent string `json:\"content\"`\n\t\t} `json:\"message\"`\n\t} `json:\"choices\"`\n}\n```\nTichyResponse is the JSON body received from /v1/chat/completions.\n\n","path":"github.com/CHESSComputing/Frontend","name":"main","synopsis":"","isRedistributable":true}
