grpc

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 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 AddressBar

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

func NewAddressBar

func NewAddressBar(theme *chapartheme.Theme, address, lastSelectedMethod string, services []domain.GRPCService) *AddressBar

func (*AddressBar) GetServerAddress

func (a *AddressBar) GetServerAddress() string

func (*AddressBar) Layout

func (a *AddressBar) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

func (*AddressBar) SetOnMethodChanged

func (a *AddressBar) SetOnMethodChanged(onMethodChanged func(method string))

func (*AddressBar) SetOnServerAddressChanged

func (a *AddressBar) SetOnServerAddressChanged(onServerAddressChanged func(url string))

func (*AddressBar) SetOnSubmit

func (a *AddressBar) SetOnSubmit(onSubmit func())

func (*AddressBar) SetSelectedMethod

func (a *AddressBar) SetSelectedMethod(method string)

func (*AddressBar) SetServices

func (a *AddressBar) SetServices(services []domain.GRPCService)

type Grpc

type Grpc struct {
	Prompt *widgets.Prompt

	Req *domain.Request

	Breadcrumb *component.Breadcrumb
	AddressBar *AddressBar

	Request  *Request
	Response *Response
	// contains filtered or unexported fields
}

func New

func New(req *domain.Request, theme *chapartheme.Theme, explorer *explorer.Explorer) *Grpc

func (*Grpc) GetResponse added in v0.2.7

func (r *Grpc) GetResponse() *domain.GRPCResponseDetail

func (*Grpc) HidePrompt

func (r *Grpc) HidePrompt()

func (*Grpc) HideRequestPrompt

func (r *Grpc) HideRequestPrompt()

func (*Grpc) Layout

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

func (*Grpc) SetDataChanged

func (r *Grpc) SetDataChanged(changed bool)

func (*Grpc) SetMethodsLoading

func (r *Grpc) SetMethodsLoading(loading bool)

func (*Grpc) SetOnCopyResponse

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

func (*Grpc) SetOnDataChanged

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

func (*Grpc) SetOnInvoke

func (r *Grpc) SetOnInvoke(f func(id string))

func (*Grpc) SetOnLoadRequestExample

func (r *Grpc) SetOnLoadRequestExample(f func(id string))

func (*Grpc) SetOnPostRequestSetChanged added in v0.2.7

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

func (*Grpc) SetOnReload

func (r *Grpc) SetOnReload(f func(id string))

func (*Grpc) SetOnRequestTabChange added in v0.2.7

func (r *Grpc) SetOnRequestTabChange(f func(id, tab string))

func (*Grpc) SetOnSave

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

func (*Grpc) SetOnSetOnTriggerRequestChanged added in v0.2.7

func (r *Grpc) SetOnSetOnTriggerRequestChanged(f func(id, collectionID, requestID string))

func (*Grpc) SetOnTitleChanged

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

func (*Grpc) SetPostRequestSetPreview added in v0.2.7

func (r *Grpc) SetPostRequestSetPreview(preview string)

func (*Grpc) SetPostRequestSetValues added in v0.2.7

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

func (*Grpc) SetPreRequestCollections added in v0.2.7

func (r *Grpc) SetPreRequestCollections(collections []*domain.Collection, selectedID string)

func (*Grpc) SetPreRequestRequests added in v0.2.7

func (r *Grpc) SetPreRequestRequests(requests []*domain.Request, selectedID string)

func (*Grpc) SetRequestBody

func (r *Grpc) SetRequestBody(body string)

func (*Grpc) SetResponse

func (r *Grpc) SetResponse(detail domain.GRPCResponseDetail)

func (*Grpc) SetResponseLoading

func (r *Grpc) SetResponseLoading(loading bool)

func (*Grpc) SetServices

func (r *Grpc) SetServices(services []domain.GRPCService)

func (*Grpc) ShowPrompt

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

func (*Grpc) ShowRequestPrompt

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

type Request

type Request struct {
	Tabs   *widgets.Tabs
	Prompt *widgets.Prompt

	ServerInfo *ServerInfo
	Body       *widgets.CodeEditor
	Metadata   *widgets.KeyValue
	Auth       *component.Auth
	Settings   *widgets.Settings

	PreRequest  *component.PrePostRequest
	PostRequest *component.PrePostRequest

	OnTabChange func(title string)
	// contains filtered or unexported fields
}

func NewRequest

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

func (*Request) Layout

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

type Response

type Response struct {
	Tabs *widgets.Tabs

	Metadata *widgets.CodeEditor
	Trailers *widgets.CodeEditor
	// 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) SetError

func (r *Response) SetError(err error)

func (*Response) SetMessage

func (r *Response) SetMessage(message string)

func (*Response) SetMetadata

func (r *Response) SetMetadata(metadata []domain.KeyValue)

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, status string, duration time.Duration, size int)

func (*Response) SetTrailers

func (r *Response) SetTrailers(trailers []domain.KeyValue)

type ServerInfo

type ServerInfo struct {
	ReloadButton *widget.Clickable
	FileSelector *widgets.FileSelector

	IsLoading bool
	// contains filtered or unexported fields
}

func NewServerInfo

func NewServerInfo(explorer *explorer.Explorer, info domain.ServerInfo) *ServerInfo

func (*ServerInfo) Layout

func (s *ServerInfo) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

func (*ServerInfo) SetOnChanged

func (s *ServerInfo) SetOnChanged(f func())

func (*ServerInfo) SetOnReload

func (s *ServerInfo) SetOnReload(f func())

Jump to

Keyboard shortcuts

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