Documentation
¶
Index ¶
Constants ¶
View Source
const BlockingMarshallingStackInstanceTemplate = `// do not modify, generated file
package stack
import (
"fmt"
"log"
"os"
"strings"
"{{PkgPathRoot}}/fullstack"
"{{PkgPathRoot}}/models"
"{{PkgPathRoot}}/orm"
"{{PkgPathRoot}}/probe"
{{pkgname}}_go "{{PkgPathRoot}}"
"github.com/gin-gonic/gin"
)
// hook marhalling to stage
type BeforeCommitImplementation struct {
marshallOnCommit string
packageName string
}
func (impl *BeforeCommitImplementation) BeforeCommit(stage *models.Stage) {
` + stackInstanceTemplateEpilogue
View Source
const DebouncedMarshallingStackInstanceTemplate = `// do not modify, generated file
package stack
import (
"fmt"
"log"
"os"
"strings"
"sync"
"time"
"{{PkgPathRoot}}/fullstack"
"{{PkgPathRoot}}/models"
"{{PkgPathRoot}}/orm"
"{{PkgPathRoot}}/probe"
{{pkgname}}_go "{{PkgPathRoot}}"
"github.com/gin-gonic/gin"
)
// hook marhalling to stage
type BeforeCommitImplementation struct {
marshallOnCommit string
packageName string
mu sync.Mutex
timer *time.Timer
}
const debounceDuration = 2 * time.Second
func (impl *BeforeCommitImplementation) BeforeCommit(stage *models.Stage) {
impl.mu.Lock()
defer impl.mu.Unlock()
// If a timer is already running, stop it.
if impl.timer != nil {
impl.timer.Stop()
}
// Start a new timer. When it fires, it will execute performMarshalling
// in a new goroutine.
impl.timer = time.AfterFunc(debounceDuration, func() {
go impl.performMarshalling(stage)
})
}
func (impl *BeforeCommitImplementation) performMarshalling(stage *models.Stage) {
` + stackInstanceTemplateEpilogue
Variables ¶
View Source
var ModelGongNewStackInstanceStructSubTemplateCode map[string]string = map[string]string{ string(rune(ModelGongNewStackInstanceSet)): ` models.SetOrchestratorOnAfterUpdate[models.{{Structname}}](stage)`, }
Functions ¶
This section is empty.
Types ¶
type ModelGongNewStackInstanceStructInsertionId ¶
type ModelGongNewStackInstanceStructInsertionId int
const (
ModelGongNewStackInstanceSet ModelGongNewStackInstanceStructInsertionId = iota
)
Click to show internal directories.
Click to hide internal directories.