worker

package
v0.0.0-...-cb11b3e Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Simple in-memory worker & queue

Index

Constants

View Source
const AUTHORIZED_KEYS_END_MARKER = "# <=== ssh-authorized-manager END marker ==="
View Source
const AUTHORIZED_KEYS_START_MARKER = "# === ssh-authorized-manager START marker ===>"

Variables

This section is empty.

Functions

func CreateServerLog

func CreateServerLog(serverRecord *models.Record, msgType string, message string, payload string) error

func SaveServerLog

func SaveServerLog(message ServerLog) error

func SetApplication

func SetApplication(application core.App)

func StartWorker

func StartWorker(application core.App)

func SubmitAndForget

func SubmitAndForget(work Work)

func SubmitAndWait

func SubmitAndWait(work Work)

Types

type AuthorizedKey

type AuthorizedKey struct {
	Options string
	Type    string
	Key     ssh.PublicKey
	Comment string
}

func (AuthorizedKey) Serialize

func (key AuthorizedKey) Serialize() string

type ServerLog

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

func NewServerLog

func NewServerLog(serverId string, msgType string, message string, payload string) ServerLog

type SyncServerWork

type SyncServerWork struct {
	Server *models.Record
}

func (*SyncServerWork) Execute

func (work *SyncServerWork) Execute() error

func (*SyncServerWork) Name

func (work *SyncServerWork) Name() string

type Work

type Work interface {
	Name() string
	Execute() error
}

Jump to

Keyboard shortcuts

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