config

package
v0.0.0-...-7360229 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildExecCommand

func BuildExecCommand(message api.Payload, c *ServerConfig) (*exec.Cmd, error)

func GetMimeTypeExtension

func GetMimeTypeExtension(mimeType string) (string, error)

func GetPassedArgs

func GetPassedArgs(args string) ([]string, error)

func IsAllowedMimeType

func IsAllowedMimeType(mimetype string, allowedFormats []string) bool

Types

type Command

type Command struct {
	// Command to execute.
	//
	// required: true
	Cmd string `yaml:"cmd"`

	// Arguments for the command.
	//
	// required: false
	Args []string `yaml:"args"`
}

Command describes the command and arguments to execute for a specific MIME type.

swagger:model Command

type ServerConfig

type ServerConfig struct {
	// Label of the server configuration used for identification.
	//
	// required: true
	Label string `yaml:"label"`

	// Label of the server configuration used for identification.
	//
	// required: false
	QueueName string `yaml:"queueName"`

	// HTTP method used for sending data to the destination server.
	//
	// required: false
	DestinationHTTPMethod string `yaml:"destinationHttpMethod"`

	// Header name for the file resource.
	//
	// required: false
	FileHeader string `yaml:"fileHeader,omitempty"`

	// Header name for additional arguments passed to the command.
	//
	// required: false
	ArgHeader string `yaml:"argHeader,omitempty"`

	// Indicates whether the authentication header should be forwarded.
	//
	// required: false
	ForwardAuth bool `yaml:"forwardAuth,omitempty"`

	// List of MIME types allowed for processing.
	//
	// required: false
	AllowedMimeTypes []string `yaml:"allowedMimeTypes"`

	// Commands and arguments ran by MIME type.
	//
	// required: false
	CmdByMimeType map[string]Command `yaml:"cmdByMimeType"`

	// Commands and arguments ran by MIME type based on the destination file format
	//
	// required: false
	MimeTypeFromDestination bool `yaml:"mimeTypeFromDestination,omitempty"`
}

ServerConfig defines server-specific configurations.

swagger:model ServerConfig

func ReadConfig

func ReadConfig(yp string) (*ServerConfig, error)

Jump to

Keyboard shortcuts

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