plugin

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MediaTypeZip means plugin file is zip
	MediaTypeZip = "application/zip"

	// MediaTypeGzip means plugin file is gzip
	MediaTypeGzip = "application/x-gzip"
)
View Source
const DownloadPluginFromURLTimeout = 10 * time.Minute

DownloadPluginFromURLTimeout is the timeout when downloading plugin from a URL

Variables

View Source
var MaxPluginSourceBytes int64 = 256 * 1024 * 1024 // 256 MiB

MaxPluginSourceBytes specifies the limit on how many bytes are allowed in the server's response to the download from URL request.

The plugin source size must be strictly less than this value.

Functions

func DownloadPluginFromURL

func DownloadPluginFromURL(ctx context.Context, pluginURL string, tmpFile io.Writer) error

DownloadPluginFromURL downloads plugin source from url to a tmp file on file system

Types

type PluginSourceType

type PluginSourceType int

PluginSourceType is an enum for plugin source

const (
	// PluginSourceTypeFile means plugin source is file
	PluginSourceTypeFile PluginSourceType = 1 + iota

	// PluginSourceTypeURL means plugin source is URL
	PluginSourceTypeURL
)

Jump to

Keyboard shortcuts

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