model

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

View Source
const StatusInfoLog = 101

StatusInfoLog is used to mark a INFO log message from the server.

Variables

This section is empty.

Functions

func FromMap

func FromMap[S, T any](m map[string]S) (T, error)

FromNMap converts m to T. See https://pkg.go.dev/github.com/mitchellh/mapstructure#section-readme

func Infof added in v0.8.0

func Infof(rs RawSender, format string, args ...interface{})

Infof logs an INFO message to the client.

func InfofFunc added in v0.8.0

func InfofFunc(rs RawSender) func(format string, args ...any)

InfofFunc returns a function that logs an INFO message to the client.

Types

type Config added in v0.8.0

type Config struct {
	// If set, the plugin should run in "dry-run" mode.
	Try bool `json:"try"`

	// The project build information.
	ProjectInfo ProjectInfo `json:"project_info"`
}

Config configures the plugin.

type Error

type Error struct {
	Msg string `json:"msg"`
}

Error holds an error message.

func NewError

func NewError(what string, err error) *Error

Error is an error that can be returned from a plugin, it's main quality is that it can be marshalled to and from TOML/JSON etc.

func (*Error) Error

func (r *Error) Error() string

type GoInfo added in v0.8.0

type GoInfo struct {
	Goos   string `json:"goos"`
	Goarch string `json:"goarch"`
}

GoInfo contains the Go environment information.

type Initializer

type Initializer interface {
	// Init initializes a config struct, that could be parsing of strings into Go objects, compiling of Glob patterns etc.
	// It returns an error if the initialization failed.
	Init() error
}

type ProjectInfo added in v0.8.0

type ProjectInfo struct {
	Project string `json:"project"`
	Tag     string `json:"tag"`
}

ProjectInfo contains the project and tag information.

type RawSender added in v0.8.0

type RawSender interface {
	SendRaw(...execrpc.Message)
}

RawSender is used to send raw messages to the client.

type Receipt added in v0.8.0

type Receipt struct {
	execrpc.Identity
	Error *Error `json:"err"`
}

Receipt passed back to the client.

Jump to

Keyboard shortcuts

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