MagicCapKernelStandards

package
v0.0.0-...-0c71034 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStandardsMap

func GetStandardsMap() map[string]func(Structure UploaderStructure) (*Uploader, error)

GetStandardsMap gets the standards map.

func ShareXParamHandler

func ShareXParamHandler(Data string, Filename string, Response string, ResponseURL string, Header *map[string]string, Regex []string) (string, error)

ShareXParamHandler is used to handle ShareX params.

func ShareXParamParse

func ShareXParamParse(Origin string, Filename string, Response string, ResponseURL string, Header *map[string]string, Regex []string) (string, error)

ShareXParamParse is used to parse a ShareX param.

Types

type ConfigOption

type ConfigOption struct {
	Required *bool        `json:"required"`
	Type     string       `json:"type"`
	Value    string       `json:"value"`
	Default  *interface{} `json:"default"`
}

ConfigOption defines a config option.

type DollarSyntaxMatch

type DollarSyntaxMatch struct {
	Start int
	End   int
	Match string
}

DollarSyntaxMatch is used to repersent a dollar syntax match.

func GetDollarSyntax

func GetDollarSyntax(Origin string) *DollarSyntaxMatch

GetDollarSyntax is used to get dollar syntax in the string.

type FTPSpec

type FTPSpec struct {
	Hostname  string `json:"hostname"`
	Port      string `json:"port"`
	Username  string `json:"username"`
	Password  string `json:"password"`
	Directory string `json:"directory"`
	BaseURL   string `json:"base_url"`
}

FTPSpec defines the FTP spec for this uploader.

type HTTPSpec

type HTTPSpec struct {
	Method   string             `json:"method"`
	URL      string             `json:"url"`
	POSTAs   *POSTAs            `json:"post_as"`
	Headers  *map[string]string `json:"headers"`
	Response *string            `json:"response"`
}

HTTPSpec defines the HTTP spec for this uploader.

type POSTAs

type POSTAs struct {
	Type string `json:"type"`
	Key  string `json:"key"`
}

POSTAs defines what the type of the POST request is.

type S3Spec

type S3Spec struct {
	AccessKeyID     string `json:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key"`
	Endpoint        string `json:"endpoint"`
	BucketName      string `json:"bucket_name"`
	BucketURL       string `json:"bucket_url"`
}

S3Spec defines the S3 spec for this uploader.

type SXCUSpec

type SXCUSpec struct {
	DestinationType *string
	RequestMethod   *string // Newer version of below.
	RequestType     *string
	Body            *string
	Parameters      *map[string]string // Newer version of below.
	Arguments       *map[string]string
	FileFormName    *string // Needed for form request types.
	RequestURL      string
	URL             string
	Headers         *map[string]string
	RegexList       []string
}

SXCUSpec defines the SXCU spec for this uploader.

type Uploader

type Uploader struct {
	Icon          string                                                                            `json:"icon"`
	Description   string                                                                            `json:"description"`
	Name          string                                                                            `json:"name"`
	ConfigOptions map[string]ConfigOption                                                           `json:"configOptions"`
	Upload        func(Config map[string]interface{}, Data []byte, Filename string) (string, error) `json:"-"`
}

Uploader defines the uploader in its final form.

func FTPInit

func FTPInit(Structure UploaderStructure) (*Uploader, error)

FTPInit defines the FTP standard.

func HTTPInit

func HTTPInit(Structure UploaderStructure) (*Uploader, error)

HTTPInit defines the HTTP standard.

func S3Init

func S3Init(Structure UploaderStructure) (*Uploader, error)

S3Init defines the S3 standard.

func SXCUInit

func SXCUInit(Structure UploaderStructure) (*Uploader, error)

SXCUInit defines the SXCU standard.

type UploaderStructure

type UploaderStructure struct {
	Icon        string                  `json:"icon"`
	Name        string                  `json:"name"`
	Description string                  `json:"description"`
	Config      map[string]ConfigOption `json:"config"`
	Spec        interface{}             `json:"spec"`
}

UploaderStructure defines the structure that an imported uploaders JSON will follow.

Jump to

Keyboard shortcuts

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