sdk

package
v0.0.0-...-adaf132 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FullFsPath

func FullFsPath(fs NestedFs, name string) string

func Setup

func Setup(opts ...SetupOption) *setup

Types

type HttpContext

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

func (*HttpContext) Http

func (c *HttpContext) Http() (*Request, *Response)

func (*HttpContext) HttpStd

func (c *HttpContext) HttpStd() (*http.Request, http.ResponseWriter)

type InputFs

type InputFs struct {
	Zip *zip.Reader
}

func (*InputFs) CopyTo

func (fs *InputFs) CopyTo(target afero.Fs) error

type NestedFs

type NestedFs = *afero.BasePathFs

func NewNestedFs

func NewNestedFs(parent afero.Fs, path string) NestedFs

func NewTempFs

func NewTempFs() (NestedFs, func() error)

type Request

type Request struct {
	Request *http.Request
}

func (*Request) InputFs

func (r *Request) InputFs() (*InputFs, error)

InputFs assumes the request to be of type multipart/form-data and extracts the inputFs from the request.

The inputFs parameter is expected to be a form file containing a zip archive.

type Response

type Response struct {
	Writer http.ResponseWriter
}

func (*Response) WriteJSON

func (r *Response) WriteJSON(status int, data any) error

func (*Response) WriteZipFs

func (r *Response) WriteZipFs(sourceFs afero.Fs) error

type SetupOption

type SetupOption func(*setup) error

func WithOpenApiSpec

func WithOpenApiSpec(spec []byte) SetupOption

type Workdir

type Workdir struct {
	Work   NestedFs
	Input  NestedFs
	Output NestedFs
	// contains filtered or unexported fields
}

func WithWorkdir

func WithWorkdir(request *Request) (*Workdir, error)

WithWorkdir creates a work directory in the OS temp directory. Then it copies the request's input files to the work directory into the "input" directory.

func (w *Workdir) Unlink() error

Jump to

Keyboard shortcuts

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