stack

package
v0.0.0-...-359db49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

do not modify, generated file

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeforeCommitImplementation

type BeforeCommitImplementation struct {
	// contains filtered or unexported fields
}

hook marhalling to stage

func (*BeforeCommitImplementation) BeforeCommit

func (impl *BeforeCommitImplementation) BeforeCommit(stage *models.StageStruct)

type Stack

type Stack struct {
	Probe    *probe.Probe
	Stage    *models.StageStruct
	BackRepo *orm.BackRepoStruct
}

func NewStack

func NewStack(
	r *gin.Engine,
	stackPath string,
	unmarshallFromCode string,
	marshallOnCommit string,
	dbFileName string,
	embeddedDiagrams bool,
	withProbe bool) (
	stack *Stack)

NewStack initializes and configures a new stack instance for a full-stack application. It sets up the backend repository, provides options for unmarshalling from Go code, automatic marshalling on commits, and initializing a probe for monitoring and visualization. The function returns a pointer to the initialized StageStruct.

Parameters:

  • r *gin.Engine: A Gin engine instance for handling HTTP requests.
  • stackPath string: A unique identifier for the stack instance, used for differentiating between different instances if needed.
  • unmarshallFromCode string: File path of a Go source code file. If provided, the function will attempt to unmarshall the stage data from this file.
  • marshallOnCommit string: If provided, sets up an automatic marshalling hook that writes the stage data to a Go source code file with this name on every commit.
  • dbFileName string: Name of the database file for persisting the stage data. If an empty string is provided, the database will be persisted in memory.
  • embeddedDiagrams bool: Flag indicating whether to embed diagrams in the probe.
  • withProbe bool: If true, initializes a probe for monitoring and visualization.

Returns: - *Stack: Pointer to the initialized stack instance.

Behavior:

  1. Initialize Stage and Backend Repository: Creates a new stage instance and a backend repository. If dbFileName is provided, it is used as the database file name; otherwise, the database is persisted in memory.
  2. Optional Unmarshalling from Go Code: If unmarshallFromCode is provided, attempts to unmarshall the stage data from the specified Go source code file. If the file is not found, a log message is printed, but the function does not terminate.
  3. Automatic Marshalling on Commit: If marshallOnCommit is provided, sets up a hook that automatically marshals the stage data to a Go source code file with the specified name on every commit.
  4. Initialize Probe (Optional): If withProbe is true, initializes a probe for monitoring and visualization.
  5. Configure Orchestration: Configures orchestration for various model structures.

func NewTranscientStack

func NewTranscientStack(r *gin.Engine, stackPath string, withProbe bool) (stack *Stack)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL