Documentation
¶
Index ¶
- Variables
- func AddHandlers(r *mux.Router)
- func CreateDocument(ds string, dataMap map[string]string, userId int64) (int64, error)
- func GetDocumentStructureList() ([]string, error)
- func MakeDataMapFromRequest(r *http.Request) map[string]string
- func UpdateDocument(ds string, docId int64, dataMap map[string]string, userId int64) error
- type DocAndStructure
- type DocData
- type Row
Constants ¶
This section is empty.
Variables ¶
View Source
var Admins []int64
View Source
var BaseTemplate string
View Source
var FILENAME_SEPARATOR = "____"
View Source
var FRCL flaarum.Client
View Source
var GetCurrentUser func(r *http.Request) (int64, error)
Functions ¶
func AddHandlers ¶
func CreateDocument ¶
This function would be used for saving in your create pages.
func MakeDataMapFromRequest ¶
Gets a dataMap (map[string]string) from the request object.
Types ¶
type DocAndStructure ¶
func GetDocument ¶
func GetDocument(ds string, docId int64, userId int64) ([]DocAndStructure, map[string]string, error)
This function can be used in your update pages or view pages. This function would get the structure and data for presentation as a form with some values. The second field contains meta information: created, created_by & modified.
type DocData ¶
type DocData struct { Label string Name string Type string Required bool Unique bool OtherOptions []string }
func GetDocData ¶
This function can be used for rendering a form. You are to loop through the returned object to create a form.
type Row ¶
type Row struct { Id string DocAndStructures []DocAndStructure NeedsUpdate bool }
func GetDocuments ¶
func GetDocuments(userId int64, documentStructure string, elementValues map[string]string, pageNum int64) ([]Row, int64, error)
This function is used for list pages. Sample input:
map[string]string { email = "jj@jj.com", order_by = "dt", order_by = "asc", }
pageNum starts from one It returns the documents in []Row, the total pages as its second output and lastly errors.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.