requests

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: BSD-3-Clause Imports: 32 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, egressService *egress.Service, grpcService *grpc.Service) *Controller

func (*Controller) LoadData

func (c *Controller) LoadData() error

type GrpcContainer

type GrpcContainer interface {
	Container
	SetOnReload(func(id string))
	SetServices(services []domain.GRPCService)
	SetMethodsLoading(loading bool)
	SetResponseLoading(loading bool)
	SetOnInvoke(f func(id string))
	SetResponse(response domain.GRPCResponseDetail)
	GetResponse() *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()
	SetPostRequestSetValues(set domain.PostRequestSet)
	SetOnPostRequestSetChanged(f func(id string, statusCode int, item, from, fromKey string))
	SetPreRequestCollections(collections []*domain.Collection, selectedID string)
	SetPreRequestRequests(requests []*domain.Request, selectedID string)
	SetOnSetOnTriggerRequestChanged(f func(id, collectionID, requestID string))
	SetPostRequestSetPreview(preview string)
	SetOnRequestTabChange(f func(id, tab string))
}

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)
	SetPreRequestCollections(collections []*domain.Collection, selectedID string)
	SetPreRequestRequests(requests []*domain.Request, selectedID string)
	SetOnSetOnTriggerRequestChanged(f func(id, collectionID, requestID string))
	SetOnRequestTabChange(f func(id, tab 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) GetGRPCResponse added in v0.2.7

func (v *View) GetGRPCResponse(id string) *domain.GRPCResponseDetail

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) HideGRPCRequestError added in v0.2.5

func (v *View) HideGRPCRequestError(id 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) SetOnRequestTabChange added in v0.2.7

func (v *View) SetOnRequestTabChange(f func(id string, tab 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) SetOnSetOnTriggerRequestChanged added in v0.2.7

func (v *View) SetOnSetOnTriggerRequestChanged(f func(id, collectionID, requestID 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) SetPreRequestCollections added in v0.2.7

func (v *View) SetPreRequestCollections(id string, collections []*domain.Collection, selectedID string)

func (*View) SetPreRequestRequests added in v0.2.7

func (v *View) SetPreRequestRequests(id string, requests []*domain.Request, selectedID 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