thestrukture/IDE

View on GitHub
types/struct_funcs.go

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
// File generated by Gopher Sauce
// DO NOT EDIT!!
package types

import (
    "encoding/json"
    "log"

    "github.com/cheikhshift/db"
)

// Asserts first argument, a map, as struct
// FSCs. This function is used with template functionality.
func CastFSCs(args ...interface{}) *FSCs {

    s := FSCs{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new FSCs struct and return the pointer.
func NewFSCs() *FSCs { return &FSCs{} }

// Asserts first argument, a map, as struct
// SearchResult. This function is used with template functionality.
func CastSearchResult(args ...interface{}) *SearchResult {

    s := SearchResult{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new SearchResult struct and return the pointer.
func NewSearchResult() *SearchResult { return &SearchResult{} }

// Asserts first argument, a map, as struct
// Dex. This function is used with template functionality.
func CastDex(args ...interface{}) *Dex {

    s := Dex{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new Dex struct and return the pointer.
func NewDex() *Dex { return &Dex{} }

// Asserts first argument, a map, as struct
// SoftUser. This function is used with template functionality.
func CastSoftUser(args ...interface{}) *SoftUser {

    s := SoftUser{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new SoftUser struct and return the pointer.
func NewSoftUser() *SoftUser { return &SoftUser{} }

// Asserts first argument, a map, as struct
// USettings. This function is used with template functionality.
func CastUSettings(args ...interface{}) *USettings {

    s := USettings{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new USettings struct and return the pointer.
func NewUSettings() *USettings { return &USettings{} }

// Asserts first argument, a map, as struct
// App. This function is used with template functionality.
func CastApp(args ...interface{}) *App {

    s := App{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new App struct and return the pointer.
func NewApp() *App { return &App{} }

// Asserts first argument, a map, as struct
// TemplateEdits. This function is used with template functionality.
func CastTemplateEdits(args ...interface{}) *TemplateEdits {

    s := TemplateEdits{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new TemplateEdits struct and return the pointer.
func NewTemplateEdits() *TemplateEdits { return &TemplateEdits{} }

// Asserts first argument, a map, as struct
// WebRootEdits. This function is used with template functionality.
func CastWebRootEdits(args ...interface{}) *WebRootEdits {

    s := WebRootEdits{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new WebRootEdits struct and return the pointer.
func NewWebRootEdits() *WebRootEdits { return &WebRootEdits{} }

// Asserts first argument, a map, as struct
// TEditor. This function is used with template functionality.
func CastTEditor(args ...interface{}) *TEditor {

    s := TEditor{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new TEditor struct and return the pointer.
func NewTEditor() *TEditor { return &TEditor{} }

// Asserts first argument, a map, as struct
// Navbars. This function is used with template functionality.
func CastNavbars(args ...interface{}) *Navbars {

    s := Navbars{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new Navbars struct and return the pointer.
func NewNavbars() *Navbars { return &Navbars{} }

// Asserts first argument, a map, as struct
// SModal. This function is used with template functionality.
func CastSModal(args ...interface{}) *SModal {

    s := SModal{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new SModal struct and return the pointer.
func NewSModal() *SModal { return &SModal{} }

// Asserts first argument, a map, as struct
// Forms. This function is used with template functionality.
func CastForms(args ...interface{}) *Forms {

    s := Forms{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new Forms struct and return the pointer.
func NewForms() *Forms { return &Forms{} }

// Asserts first argument, a map, as struct
// SButton. This function is used with template functionality.
func CastSButton(args ...interface{}) *SButton {

    s := SButton{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new SButton struct and return the pointer.
func NewSButton() *SButton { return &SButton{} }

// Asserts first argument, a map, as struct
// STab. This function is used with template functionality.
func CastSTab(args ...interface{}) *STab {

    s := STab{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new STab struct and return the pointer.
func NewSTab() *STab { return &STab{} }

// Asserts first argument, a map, as struct
// DForm. This function is used with template functionality.
func CastDForm(args ...interface{}) *DForm {

    s := DForm{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new DForm struct and return the pointer.
func NewDForm() *DForm { return &DForm{} }

// Asserts first argument, a map, as struct
// Alertbs. This function is used with template functionality.
func CastAlertbs(args ...interface{}) *Alertbs {

    s := Alertbs{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new Alertbs struct and return the pointer.
func NewAlertbs() *Alertbs { return &Alertbs{} }

// Asserts first argument, a map, as struct
// Inputs. This function is used with template functionality.
func CastInputs(args ...interface{}) *Inputs {

    s := Inputs{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new Inputs struct and return the pointer.
func NewInputs() *Inputs { return &Inputs{} }

// Asserts first argument, a map, as struct
// Aput. This function is used with template functionality.
func CastAput(args ...interface{}) *Aput {

    s := Aput{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new Aput struct and return the pointer.
func NewAput() *Aput { return &Aput{} }

// Asserts first argument, a map, as struct
// RPut. This function is used with template functionality.
func CastRPut(args ...interface{}) *RPut {

    s := RPut{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new RPut struct and return the pointer.
func NewRPut() *RPut { return &RPut{} }

// Asserts first argument, a map, as struct
// SSWAL. This function is used with template functionality.
func CastSSWAL(args ...interface{}) *SSWAL {

    s := SSWAL{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new SSWAL struct and return the pointer.
func NewSSWAL() *SSWAL { return &SSWAL{} }

// Asserts first argument, a map, as struct
// SPackageEdit. This function is used with template functionality.
func CastSPackageEdit(args ...interface{}) *SPackageEdit {

    s := SPackageEdit{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new SPackageEdit struct and return the pointer.
func NewSPackageEdit() *SPackageEdit { return &SPackageEdit{} }

// Asserts first argument, a map, as struct
// DebugObj. This function is used with template functionality.
func CastDebugObj(args ...interface{}) *DebugObj {

    s := DebugObj{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new DebugObj struct and return the pointer.
func NewDebugObj() *DebugObj { return &DebugObj{} }

// Asserts first argument, a map, as struct
// DebugNode. This function is used with template functionality.
func CastDebugNode(args ...interface{}) *DebugNode {

    s := DebugNode{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new DebugNode struct and return the pointer.
func NewDebugNode() *DebugNode { return &DebugNode{} }

// Asserts first argument, a map, as struct
// PkgItem. This function is used with template functionality.
func CastPkgItem(args ...interface{}) *PkgItem {

    s := PkgItem{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new PkgItem struct and return the pointer.
func NewPkgItem() *PkgItem { return &PkgItem{} }

// Asserts first argument, a map, as struct
// SROC. This function is used with template functionality.
func CastSROC(args ...interface{}) *SROC {

    s := SROC{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new SROC struct and return the pointer.
func NewSROC() *SROC { return &SROC{} }

// Asserts first argument, a map, as struct
// VHuf. This function is used with template functionality.
func CastVHuf(args ...interface{}) *VHuf {

    s := VHuf{}
    mapp := args[0].(db.O)
    if _, ok := mapp["_id"]; ok {
        mapp["Id"] = mapp["_id"]
    }
    data, _ := json.Marshal(&mapp)

    err := json.Unmarshal(data, &s)
    if err != nil {
        log.Println(err.Error())
    }

    return &s
}

// Create a new VHuf struct and return the pointer.
func NewVHuf() *VHuf { return &VHuf{} }