restful

package
v0.2.1-beta Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	DropDown *widgets.DropDown

	FormData *component.FormData

	BinaryFile *widgets.BinaryFile
	// contains filtered or unexported fields
}

func NewBody

func NewBody(body domain.Body, theme *chapartheme.Theme) *Body

func (*Body) Layout

func (b *Body) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

func (*Body) SetOnChange

func (b *Body) SetOnChange(f func(body domain.Body))

type Headers

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

func NewHeaders

func NewHeaders(headers []domain.KeyValue) *Headers

func (*Headers) Layout

func (h *Headers) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

func (*Headers) SetHeaders

func (h *Headers) SetHeaders(headers []domain.KeyValue)

func (*Headers) SetOnChange

func (h *Headers) SetOnChange(f func(values []domain.KeyValue))

type Params

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

func NewParams

func NewParams(queryParams []domain.KeyValue, pathParams []domain.KeyValue) *Params

func (*Params) Layout

func (p *Params) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

func (*Params) SetOnChange

func (p *Params) SetOnChange(f func(queryParams []domain.KeyValue, pathParams []domain.KeyValue))

func (*Params) SetPathParams

func (p *Params) SetPathParams(pathParams []domain.KeyValue)

func (*Params) SetQueryParams

func (p *Params) SetQueryParams(queryParams []domain.KeyValue)

type Request

type Request struct {
	Tabs *widgets.Tabs

	PreRequest  *component.PrePostRequest
	PostRequest *component.PrePostRequest

	Body    *Body
	Params  *Params
	Headers *Headers
	Auth    *component.Auth
}

func NewRequest

func NewRequest(req *domain.Request, theme *chapartheme.Theme) *Request

func (*Request) Layout

func (r *Request) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

type Response

type Response struct {
	Tabs *widgets.Tabs
	// contains filtered or unexported fields
}

func NewResponse

func NewResponse(theme *chapartheme.Theme) *Response

func (*Response) Layout

func (r *Response) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

func (*Response) SetCookies

func (r *Response) SetCookies(cookies []domain.KeyValue)

func (*Response) SetError

func (r *Response) SetError(err error)

func (*Response) SetHeaders

func (r *Response) SetHeaders(headers []domain.KeyValue)

func (*Response) SetMessage

func (r *Response) SetMessage(message string)

func (*Response) SetOnCopyResponse

func (r *Response) SetOnCopyResponse(f func(gtx layout.Context, dataType, data string))

func (*Response) SetResponse

func (r *Response) SetResponse(response string)

func (*Response) SetStatusParams

func (r *Response) SetStatusParams(code int, duration time.Duration, size int)

type Restful

type Restful struct {
	Prompt *widgets.Prompt

	Req *domain.Request

	Breadcrumb *component.Breadcrumb
	AddressBar *component.AddressBar
	Response   *Response
	Request    *Request
	// contains filtered or unexported fields
}

func New

func New(req *domain.Request, theme *chapartheme.Theme) *Restful

func (*Restful) AddFileToFormData

func (r *Restful) AddFileToFormData(fieldId, filePath string)

func (*Restful) GetHTTPResponse

func (r *Restful) GetHTTPResponse() *domain.HTTPResponseDetail

func (*Restful) HidePrompt

func (r *Restful) HidePrompt()

func (*Restful) HideSendingRequestLoading

func (r *Restful) HideSendingRequestLoading()

func (*Restful) Layout

func (r *Restful) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

func (*Restful) SetBinaryBodyFilePath

func (r *Restful) SetBinaryBodyFilePath(filePath string)

func (*Restful) SetDataChanged

func (r *Restful) SetDataChanged(changed bool)

func (*Restful) SetHTTPResponse

func (r *Restful) SetHTTPResponse(detail domain.HTTPResponseDetail)

func (*Restful) SetOnBinaryFileSelect

func (r *Restful) SetOnBinaryFileSelect(f func(id string))

func (*Restful) SetOnCopyResponse

func (r *Restful) SetOnCopyResponse(f func(gtx layout.Context, dataType, data string))

func (*Restful) SetOnDataChanged

func (r *Restful) SetOnDataChanged(f func(id string, data any))

func (*Restful) SetOnFormDataFileSelect

func (r *Restful) SetOnFormDataFileSelect(f func(requestId, fieldId string))

func (*Restful) SetOnPostRequestSetChanged

func (r *Restful) SetOnPostRequestSetChanged(f func(id string, statusCode int, item, from, fromKey string))

func (*Restful) SetOnSave

func (r *Restful) SetOnSave(f func(id string))

func (*Restful) SetOnSubmit

func (r *Restful) SetOnSubmit(f func(id string))

func (*Restful) SetOnTitleChanged

func (r *Restful) SetOnTitleChanged(f func(title string))

func (*Restful) SetPathParams

func (r *Restful) SetPathParams(params []domain.KeyValue)

func (*Restful) SetPostRequestSetPreview

func (r *Restful) SetPostRequestSetPreview(preview string)

func (*Restful) SetPostRequestSetValues

func (r *Restful) SetPostRequestSetValues(set domain.PostRequestSet)

func (*Restful) SetQueryParams

func (r *Restful) SetQueryParams(params []domain.KeyValue)

func (*Restful) SetURL

func (r *Restful) SetURL(url string)

func (*Restful) ShowPrompt

func (r *Restful) ShowPrompt(title, content, modalType string, onSubmit func(selectedOption string, remember bool), options ...widgets.Option)

func (*Restful) ShowSendingRequestLoading

func (r *Restful) ShowSendingRequestLoading()

Jump to

Keyboard shortcuts

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