runmode

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Authorization = "Authorization"
	ContentType   = "Content-Type"

	ApplicationJson = "application/json"
)

Variables

This section is empty.

Functions

func LoadUsers

func LoadUsers(c config.Config) (map[model.Identifier]*model.User, error)

func ShouldEnterRunMode

func ShouldEnterRunMode(rm RUN_MODE_TYPE) bool

convert to interface and client

Types

type INSTRUCTION_TYPE

type INSTRUCTION_TYPE string
const (
	INSTRUCTION_TYPE_CMD INSTRUCTION_TYPE = "INSTRUCTION_TYPE_CMD"
)

type Instruction

type Instruction struct {
	Commands []string `json:"commands" xml:"commands" form:"commands" validate:"required"`
}

type InstructionOutput

type InstructionOutput struct {
	Command   string `json:"command" xml:"command" form:"command"`
	Output    string `json:"output" xml:"output" form:"output"`
	Error     string `json:"error" xml:"error" form:"error"`
	IsSuccess bool   `json:"isSuccess" xml:"isSuccess" form:"isSuccess"`
}

type MaintenanceModeOpts

type MaintenanceModeOpts struct {
	RunModeOpts RunModeOpts
}

func NewMaintenanceMode

func NewMaintenanceMode(c config.Config) (*MaintenanceModeOpts, error)

func (*MaintenanceModeOpts) Close

func (mmo *MaintenanceModeOpts) Close(c *fiber.Ctx) error

func (*MaintenanceModeOpts) EnterMaintenanceMode

func (mmo *MaintenanceModeOpts) EnterMaintenanceMode() error

func (*MaintenanceModeOpts) Patch

func (mmo *MaintenanceModeOpts) Patch(c *fiber.Ctx) error

type PatchApiResponse

type PatchApiResponse struct {
	Message        string              `json:"message" xml:"message" form:"message"`
	Status         string              `json:"status" xml:"status" form:"status"`
	CommandOutputs []InstructionOutput `json:"commandOutputs" xml:"commandOutputs" form:"commandOutputs"`
	Error          *string             `json:"error" xml:"error" form:"error"`
}

type RUN_MODE_TYPE

type RUN_MODE_TYPE string
const (
	RUN_MODE_MAINTENANCE RUN_MODE_TYPE = "RUN_MODE_MAINTENANCE"
	RUN_MODE_NORMAL      RUN_MODE_TYPE = "RUN_MODE_NORMAL"
	RUN_MODE_UPGRADE     RUN_MODE_TYPE = "RUN_MODE_UPGRADE"
)

type RunInstructions

type RunInstructions struct {
	ToolName        *string `json:"tool_name"`
	ToolPath        *string `json:"tool_path"`
	ToolArgs        *string `json:"tool_args"`
	InstructionType *string `json:"instruction_type"`
	Instructions    *string `json:"instructions"`
}

type RunModeOpts

type RunModeOpts struct {
	Users  map[model.Identifier]*model.User
	Config config.Config
	// contains filtered or unexported fields
}

func (*RunModeOpts) AuthenticateUser

func (rmo *RunModeOpts) AuthenticateUser(requesterId model.Identifier, password string) (bool, *wdbErrors.WdbError)

Jump to

Keyboard shortcuts

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