requests

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: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeRequest    = "request"
	TypeCollection = "collection"

	TypeMeta = "Type"
)
View Source
const (
	MenuDuplicate      = "Duplicate"
	MenuDelete         = "Delete"
	MenuAddHTTPRequest = "Add HTTP Request"
	MenuAddGRPCRequest = "Add GRPC Request"
	MenuView           = "View"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
	SetOnDataChanged(f func(id string, data any))
	SetOnTitleChanged(f func(title string))
	SetDataChanged(changed bool)
	SetOnSave(f func(id string))
	ShowPrompt(title, content, modalType string, onSubmit func(selectedOption string, remember bool), options ...widgets.Option)
	HidePrompt()
}

type Controller

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

func NewController

func NewController(view *View, repo repository.Repository, model *state.Requests, envState *state.Environments, explorer *explorer.Explorer, restService *rest.Service, grpcService *grpc.Service) *Controller

func (*Controller) LoadData

func (c *Controller) LoadData() error

type GrpcContainer

type GrpcContainer interface {
	Container
	SetOnProtoFileSelect(func(id string))
	SetProtoBodyFilePath(filePath string)
	SetOnReload(func(id string))
	SetServices(services []domain.GRPCService)
	SetMethodsLoading(loading bool)
	SetResponseLoading(loading bool)
	SetOnInvoke(f func(id string))
	SetResponse(response domain.GRPCResponseDetail)
	SetOnLoadRequestExample(f func(id string))
	SetRequestBody(body string)
	ShowRequestPrompt(title, content, modalType string, onSubmit func(selectedOption string, remember bool), options ...widgets.Option)
	HideRequestPrompt()
}

type RestContainer

type RestContainer interface {
	Container
	SetHTTPResponse(response domain.HTTPResponseDetail)
	GetHTTPResponse() *domain.HTTPResponseDetail
	SetPostRequestSetPreview(preview string)
	ShowSendingRequestLoading()
	HideSendingRequestLoading()
	SetQueryParams(params []domain.KeyValue)
	SetPathParams(params []domain.KeyValue)
	SetURL(url string)
	SetPostRequestSetValues(set domain.PostRequestSet)
	SetOnPostRequestSetChanged(f func(id string, statusCode int, item, from, fromKey string))
	SetOnBinaryFileSelect(f func(id string))
	SetBinaryBodyFilePath(filePath string)
	SetOnFormDataFileSelect(f func(requestId, fieldId string))
	AddFileToFormData(fieldId, filePath string)
}

type View

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

func NewView

func NewView(w *app.Window, theme *chapartheme.Theme, explorer *explorer.Explorer) *View

func (*View) AddChildTreeViewNode

func (v *View) AddChildTreeViewNode(parentID string, req *domain.Request)

func (*View) AddCollectionTreeViewNode

func (v *View) AddCollectionTreeViewNode(collection *domain.Collection)

func (*View) AddFileToFormData

func (v *View) AddFileToFormData(requestId, fieldId, filePath string)

func (*View) AddRequestTreeViewNode

func (v *View) AddRequestTreeViewNode(req *domain.Request)

func (*View) AddTreeViewNode

func (v *View) AddTreeViewNode(req *domain.Request)

func (*View) CloseTab

func (v *View) CloseTab(id string)

func (*View) ExpandTreeViewNode

func (v *View) ExpandTreeViewNode(id string)

func (*View) GetHTTPResponse

func (v *View) GetHTTPResponse(id string) *domain.HTTPResponseDetail

func (*View) GetTabType

func (v *View) GetTabType(id string) string

func (*View) GetTreeViewNodeType

func (v *View) GetTreeViewNodeType(id string) string

func (*View) HidePrompt

func (v *View) HidePrompt(id string)

func (*View) IsTabOpen

func (v *View) IsTabOpen(id string) bool

func (*View) Layout

func (v *View) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

func (*View) OpenCollectionContainer

func (v *View) OpenCollectionContainer(collection *domain.Collection)

func (*View) OpenRequestContainer

func (v *View) OpenRequestContainer(req *domain.Request)

func (*View) OpenTab

func (v *View) OpenTab(id, name, tabType string)

func (*View) PopulateTreeView

func (v *View) PopulateTreeView(requests []*domain.Request, collections []*domain.Collection)

func (*View) RemoveTreeViewNode

func (v *View) RemoveTreeViewNode(id string)

func (*View) SetBinaryBodyFilePath

func (v *View) SetBinaryBodyFilePath(id, filePath string)

func (*View) SetGRPCMethodsLoading

func (v *View) SetGRPCMethodsLoading(id string, loading bool)

func (*View) SetGRPCResponse

func (v *View) SetGRPCResponse(id string, response domain.GRPCResponseDetail)

func (*View) SetGRPCServices

func (v *View) SetGRPCServices(id string, services []domain.GRPCService)

func (*View) SetHTTPResponse

func (v *View) SetHTTPResponse(id string, response domain.HTTPResponseDetail)

func (*View) SetOnBinaryFileSelect

func (v *View) SetOnBinaryFileSelect(f func(id string))

func (*View) SetOnCopyResponse

func (v *View) SetOnCopyResponse(onCopyResponse func(gtx layout.Context, dataType, data string))

func (*View) SetOnDataChanged

func (v *View) SetOnDataChanged(onDataChanged func(id string, data any, containerType string))

func (*View) SetOnFormDataFileSelect

func (v *View) SetOnFormDataFileSelect(f func(requestId, fieldId string))

func (*View) SetOnGrpcInvoke

func (v *View) SetOnGrpcInvoke(f func(id string))

func (*View) SetOnGrpcLoadRequestExample

func (v *View) SetOnGrpcLoadRequestExample(f func(id string))

func (*View) SetOnImport

func (v *View) SetOnImport(f func())

func (*View) SetOnNewCollection

func (v *View) SetOnNewCollection(onNewCollection func())

func (*View) SetOnNewRequest

func (v *View) SetOnNewRequest(onNewRequest func(requestType string))

func (*View) SetOnPostRequestSetChanged

func (v *View) SetOnPostRequestSetChanged(f func(id string, statusCode int, item, from, fromKey string))

func (*View) SetOnProtoFileSelect

func (v *View) SetOnProtoFileSelect(f func(id string))

func (*View) SetOnSave

func (v *View) SetOnSave(onSave func(id string))

func (*View) SetOnServerInfoReload

func (v *View) SetOnServerInfoReload(f func(id string))

func (*View) SetOnSubmit

func (v *View) SetOnSubmit(f func(id, containerType string))

func (*View) SetOnTabClose

func (v *View) SetOnTabClose(onTabClose func(id string))

func (*View) SetOnTabSelected

func (v *View) SetOnTabSelected(onTabSelected func(id string))

func (*View) SetOnTitleChanged

func (v *View) SetOnTitleChanged(onTitleChanged func(id, title, containerType string))

func (*View) SetOnTreeViewMenuClicked

func (v *View) SetOnTreeViewMenuClicked(onTreeViewMenuClicked func(id, action string))

func (*View) SetOnTreeViewNodeClicked

func (v *View) SetOnTreeViewNodeClicked(onTreeViewNodeClicked func(id string))

func (*View) SetOnTreeViewNodeDoubleClicked

func (v *View) SetOnTreeViewNodeDoubleClicked(onTreeViewNodeDoubleClicked func(id string))

func (*View) SetPathParams

func (v *View) SetPathParams(id string, params []domain.KeyValue)

func (*View) SetPostRequestSetPreview

func (v *View) SetPostRequestSetPreview(id, preview string)

func (*View) SetPostRequestSetValues

func (v *View) SetPostRequestSetValues(id string, set domain.PostRequestSet)

func (*View) SetProtoFilePath

func (v *View) SetProtoFilePath(id, filePath string)

func (*View) SetQueryParams

func (v *View) SetQueryParams(id string, params []domain.KeyValue)

func (*View) SetSendingRequestLoaded

func (v *View) SetSendingRequestLoaded(id string)

func (*View) SetSendingRequestLoading

func (v *View) SetSendingRequestLoading(id string)

func (*View) SetSetGrpcRequestBody

func (v *View) SetSetGrpcRequestBody(id, body string)

func (*View) SetTabDirty

func (v *View) SetTabDirty(id string, dirty bool)

func (*View) SetTreeViewNodePrefix

func (v *View) SetTreeViewNodePrefix(id string, req *domain.Request)

func (*View) SetURL

func (v *View) SetURL(id, url string)

func (*View) ShowGRPCRequestError

func (v *View) ShowGRPCRequestError(id, title, content string)

func (*View) ShowPrompt

func (v *View) ShowPrompt(id, title, content, modalType string, onSubmit func(selectedOption string, remember bool), options ...widgets.Option)

func (*View) SwitchToTab

func (v *View) SwitchToTab(id string)

func (*View) UpdateTabTitle

func (v *View) UpdateTabTitle(id, title string)

func (*View) UpdateTreeNodeTitle

func (v *View) UpdateTreeNodeTitle(id, title string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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