pluginutil

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MPL-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package pluginutil provides utility functions for plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToStruct

func ToStruct(config map[string]any, target any) error

ToStruct unmarshals the given config map to the target struct.

For this to work, the target struct must be a pointer to a struct with JSON struct tags.

Types

type Error added in v1.1.0

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

Error is a custom error type that implements interfaces for HTTP errors that is used by the default ika error handler.

func NewError added in v1.2.0

func NewError(title, detail, typeURI string, status int) Error

NewError creates a new Error.

func (Error) Detail added in v1.3.0

func (e Error) Detail() string

func (Error) Error added in v1.1.0

func (e Error) Error() string

Error returns the detail of the error.

func (Error) Status added in v1.1.0

func (e Error) Status() int

Status returns the status code of the error.

func (Error) Title added in v1.1.0

func (e Error) Title() string

Title returns the title of the error.

func (Error) TypeURI added in v1.1.0

func (e Error) TypeURI() string

TypeURI returns the type URI of the error.

Jump to

Keyboard shortcuts

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