component

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageTypeInfo    = "info"
	MessageTypeError   = "error"
	MessageTypeWarning = "warning"
)
View Source
const (
	TypeScript         = "script"
	TypeSetEnv         = "set_env"
	TypeShellScript    = "shell_script"
	TypeK8sTunnel      = "kubectl_tunnel"
	TypeSSHTunnel      = "ssh_tunnel"
	TypeTriggerRequest = "trigger_request"
)

Variables

This section is empty.

Functions

func Message

func Message(gtx layout.Context, messageType string, theme *chapartheme.Theme, message string) layout.Dimensions

Types

type Actions added in v0.3.2

type Actions struct {
	SaveButton widget.Clickable
	CodeButton widget.Clickable

	IsDataChanged bool
	// contains filtered or unexported fields
}

func NewActions added in v0.3.2

func NewActions(showCode bool) *Actions

func (*Actions) Layout added in v0.3.2

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

type AddressBar

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

func NewAddressBar

func NewAddressBar(theme *chapartheme.Theme, address, method string) *AddressBar

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) SetOnSubmit

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

func (*AddressBar) SetOnURLChanged

func (a *AddressBar) SetOnURLChanged(onURLChanged func(url string))

func (*AddressBar) SetSelectedMethod

func (a *AddressBar) SetSelectedMethod(method string)

func (*AddressBar) SetURL

func (a *AddressBar) SetURL(url string)

type Auth

type Auth struct {
	DropDown *widgets.DropDown

	TokenForm  *Form
	BasicForm  *Form
	APIKeyForm *Form
	// contains filtered or unexported fields
}

func NewAuth

func NewAuth(auth domain.Auth, theme *chapartheme.Theme) *Auth

func (*Auth) Layout

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

func (*Auth) SetAuth

func (a *Auth) SetAuth(auth domain.Auth)

func (*Auth) SetOnChange

func (a *Auth) SetOnChange(f func(auth domain.Auth))
type Breadcrumb struct {
	ID             string
	ContainerType  string
	CollectionName string
	Title          *widgets.EditableLabel
	// contains filtered or unexported fields
}

func NewBreadcrumb

func NewBreadcrumb(id, name, cType, title string) *Breadcrumb
func (b *Breadcrumb) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions
func (b *Breadcrumb) SetContainerType(cType string)
func (b *Breadcrumb) SetOnTitleChanged(f func(title string))

type CodeModal added in v0.3.2

type CodeModal struct {
	CopyButton  widget.Clickable
	CloseButton widget.Clickable
	// contains filtered or unexported fields
}

func NewCodeModal added in v0.3.2

func NewCodeModal(theme *chapartheme.Theme) *CodeModal

func (*CodeModal) Layout added in v0.3.2

func (c *CodeModal) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

func (*CodeModal) SetRequest added in v0.3.2

func (c *CodeModal) SetRequest(req *domain.Request)

func (*CodeModal) SetVisible added in v0.3.2

func (c *CodeModal) SetVisible(visible bool)

type Field

type Field struct {
	Label string
	Value string

	Editor *widgets.PatternEditor
}

type Form

type Form struct {
	Fields []*Field
	// contains filtered or unexported fields
}

func NewForm

func NewForm(fields []*Field) *Form

func (*Form) GetValues

func (f *Form) GetValues() map[string]string

func (*Form) Layout

func (f *Form) Layout(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

func (*Form) SetOnChange

func (f *Form) SetOnChange(onChange func(values map[string]string))

func (*Form) SetValues

func (f *Form) SetValues(values map[string]string)

type FormData

type FormData struct {
	Fields []*FormDataField
	// contains filtered or unexported fields
}

func NewFormData

func NewFormData(theme *chapartheme.Theme, fields ...*FormDataField) *FormData

func (*FormData) AddFile

func (f *FormData) AddFile(id string, file string)

func (*FormData) GetValues

func (f *FormData) GetValues() []domain.FormField

func (*FormData) Layout

func (f *FormData) Layout(gtx layout.Context, title, hint string, theme *chapartheme.Theme) layout.Dimensions

func (*FormData) SetOnChanged

func (f *FormData) SetOnChanged(fn func(values []domain.FormField))

func (*FormData) SetOnSelectFile

func (f *FormData) SetOnSelectFile(fn func(id string))

func (*FormData) SetValues

func (f *FormData) SetValues(values []domain.FormField)

type FormDataField

type FormDataField struct {
	Type       string
	Identifier string
	Key        string
	Value      string
	Files      []string
	Enable     bool
	// contains filtered or unexported fields
}

func NewFormDataField

func NewFormDataField(t FormDataFieldType, key, value string, files []string) *FormDataField

type FormDataFieldType

type FormDataFieldType string
const (
	FormDataFieldTypeText FormDataFieldType = "text"
	FormDataFieldTypeFile FormDataFieldType = "file"
)

type KeyValue

type KeyValue struct {
	Key   string
	Value string
	// contains filtered or unexported fields
}

type Option

type Option struct {
	Title string
	Value string
	Type  string
	Hint  string
}

type PrePostRequest

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

func NewPrePostRequest

func NewPrePostRequest(actions []Option, setFormFromDropDown *widgets.DropDown, theme *chapartheme.Theme) *PrePostRequest

func (*PrePostRequest) Layout

func (*PrePostRequest) SetCode

func (p *PrePostRequest) SetCode(code string)

func (*PrePostRequest) SetCollections added in v0.2.7

func (p *PrePostRequest) SetCollections(collections []*domain.Collection, selectedID string)

func (*PrePostRequest) SetEnvForm

func (p *PrePostRequest) SetEnvForm(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

func (*PrePostRequest) SetOnDropDownChanged

func (p *PrePostRequest) SetOnDropDownChanged(f func(selected string))

func (*PrePostRequest) SetOnPostRequestSetChanged

func (p *PrePostRequest) SetOnPostRequestSetChanged(f func(statusCode int, item, from, fromKey string))

func (*PrePostRequest) SetOnScriptChanged

func (p *PrePostRequest) SetOnScriptChanged(f func(script string))

func (*PrePostRequest) SetOnTriggerRequestChanged added in v0.2.7

func (p *PrePostRequest) SetOnTriggerRequestChanged(f func(collectionID, requestID string))

func (*PrePostRequest) SetPostRequestSetValues

func (p *PrePostRequest) SetPostRequestSetValues(set domain.PostRequestSet)

func (*PrePostRequest) SetPreview

func (p *PrePostRequest) SetPreview(preview string)

func (*PrePostRequest) SetRequests added in v0.2.7

func (p *PrePostRequest) SetRequests(requests []*domain.Request, selectedID string)

func (*PrePostRequest) SetSelectedDropDown

func (p *PrePostRequest) SetSelectedDropDown(selected string)

func (*PrePostRequest) TriggerRequestForm added in v0.2.7

func (p *PrePostRequest) TriggerRequestForm(gtx layout.Context, theme *chapartheme.Theme) layout.Dimensions

type SetEnvForm

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

type TriggerRequestForm added in v0.2.7

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

type ValuesTable

type ValuesTable struct {
	Title  string
	Values []KeyValue
	// contains filtered or unexported fields
}

func NewValuesTable

func NewValuesTable(title string, values []KeyValue) *ValuesTable

func (*ValuesTable) GetData

func (v *ValuesTable) GetData() []domain.KeyValue

func (*ValuesTable) Layout

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

func (*ValuesTable) SetData

func (v *ValuesTable) SetData(values []domain.KeyValue)

Jump to

Keyboard shortcuts

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