Documentation ¶
Index ¶
- Constants
- func Clone[T any](org *T) (*T, error)
- func CompareAPIKey(a, b *APIKeyAuth) bool
- func CompareAuth(a, b Auth) bool
- func CompareBasicAuth(a, b *BasicAuth) bool
- func CompareBody(a, b Body) bool
- func CompareEnvValue(a, b KeyValue) bool
- func CompareFormData(a, b FormData) bool
- func CompareFormField(a, b FormField) bool
- func CompareGRPCMethods(a, b []GRPCMethod) bool
- func CompareGRPCRequestSpecs(a, b *GRPCRequestSpec) bool
- func CompareGRPCServices(a, b []GRPCService) bool
- func CompareHTTPRequestSpecs(a, b *HTTPRequestSpec) bool
- func CompareHTTPRequests(a, b *HTTPRequest) bool
- func CompareHTTPResponses(a, b HTTPResponse) bool
- func CompareKeyValues(a, b []KeyValue) bool
- func CompareKubernetesTunnel(a, b *KubernetesTunnel) bool
- func ComparePostRequest(a, b PostRequest) bool
- func ComparePostRequestSet(a, b PostRequestSet) bool
- func ComparePreRequest(a, b PreRequest) bool
- func CompareProtoFileSpecs(a, b ProtoFileSpec) bool
- func CompareProtoFiles(a, b *ProtoFile) bool
- func CompareRequests(a, b *Request) bool
- func CompareSShTunnel(a, b *SShTunnel) bool
- func CompareServerInfo(a, b ServerInfo) bool
- func CompareSettings(a, b Settings) bool
- func CompareTokenAuth(a, b *TokenAuth) bool
- func EncodeQueryParams(params []KeyValue) string
- func IsHTTPResponseEmpty(r HTTPResponse) bool
- func KeyValuesToText(values []KeyValue) string
- type APIKeyAuth
- type ActiveWorkspace
- type Auth
- type BasicAuth
- type Body
- type ColSpec
- type Collection
- type Config
- type ConfigSpec
- type EnvSpec
- type Environment
- type FormData
- type FormField
- type GRPCMethod
- type GRPCRequestSpec
- type GRPCResponseDetail
- type GRPCService
- type HTTPRequest
- type HTTPRequestSpec
- type HTTPResponse
- type HTTPResponseDetail
- type KeyValue
- type KubernetesTunnel
- type LastUsedEnvironment
- type Log
- type MetaData
- type PostRequest
- type PostRequestSet
- type PreRequest
- type PrefSpec
- type Preferences
- type ProtoFile
- type ProtoFileSpec
- type Request
- type RequestMeta
- type RequestSpec
- type SShTunnel
- type SelectedEnvironment
- type ServerInfo
- type Settings
- type TokenAuth
- type Workspace
Constants ¶
View Source
const ( ApiVersion = "v1" KindConfig = "Config" KindWorkspace = "Workspace" KindProtoFile = "ProtoFile" KindEnv = "Environment" KindRequest = "Request" KindPreferences = "Preferences" KindCollection = "Collection" )
View Source
const ( RequestTypeHTTP = "http" RequestTypeGRPC = "grpc" RequestMethodGET = "GET" RequestMethodPOST = "POST" RequestMethodPUT = "PUT" RequestMethodDELETE = "DELETE" RequestMethodPATCH = "PATCH" RequestMethodHEAD = "HEAD" RequestMethodOPTIONS = "OPTIONS" RequestMethodCONNECT = "CONNECT" RequestMethodTRACE = "TRACE" RequestBodyTypeNone = "none" RequestBodyTypeJSON = "json" RequestBodyTypeXML = "xml" RequestBodyTypeText = "text" RequestBodyTypeForm = "form" RequestBodyTypeBinary = "binary" RequestBodyTypeUrlEncoded = "urlEncoded" PrePostTypeNone = "none" PrePostTypePython = "python" PrePostTypeShell = "ssh" PrePostTypeSSHTunnel = "sshTunnel" PrePostTypeK8sTunnel = "k8sTunnel" )
View Source
const ( AuthTypeNone = "none" AuthTypeBasic = "basic" AuthTypeToken = "token" AuthTypeAPIKey = "apiKey" )
View Source
const ( PostRequestTypeNone = "none" PostRequestTypeSetEnv = "setEnv" PostRequestTypePythonScript = "pythonScript" PostRequestTypeK8sTunnel = "k8sTunnel" PostRequestTypeSSHTunnel = "sshTunnel" PostRequestTypeShellScript = "shellScript" )
View Source
const ( PostRequestSetFromResponseHeader = "responseHeader" PostRequestSetFromResponseBody = "responseBody" PostRequestSetFromResponseCookie = "responseCookie" )
View Source
const ( BodyTypeNone = "none" BodyTypeJSON = "json" BodyTypeText = "text" BodyTypeXML = "xml" BodyTypeFormData = "formData" BodyTypeBinary = "binary" BodyTypeUrlencoded = "urlencoded" )
View Source
const ( FormFieldTypeText = "text" FormFieldTypeFile = "file" )
View Source
const DefaultWorkspaceName = "Default Workspace"
Variables ¶
This section is empty.
Functions ¶
func CompareAPIKey ¶
func CompareAPIKey(a, b *APIKeyAuth) bool
func CompareAuth ¶
func CompareBasicAuth ¶
func CompareBody ¶
func CompareEnvValue ¶
func CompareFormData ¶
func CompareFormField ¶
func CompareGRPCMethods ¶
func CompareGRPCMethods(a, b []GRPCMethod) bool
func CompareGRPCRequestSpecs ¶
func CompareGRPCRequestSpecs(a, b *GRPCRequestSpec) bool
func CompareGRPCServices ¶
func CompareGRPCServices(a, b []GRPCService) bool
func CompareHTTPRequestSpecs ¶
func CompareHTTPRequestSpecs(a, b *HTTPRequestSpec) bool
func CompareHTTPRequests ¶
func CompareHTTPRequests(a, b *HTTPRequest) bool
func CompareHTTPResponses ¶
func CompareHTTPResponses(a, b HTTPResponse) bool
func CompareKeyValues ¶
CompareKeyValues compares two slices of KeyValue and returns true if they are equal
func CompareKubernetesTunnel ¶
func CompareKubernetesTunnel(a, b *KubernetesTunnel) bool
func ComparePostRequest ¶
func ComparePostRequest(a, b PostRequest) bool
func ComparePostRequestSet ¶
func ComparePostRequestSet(a, b PostRequestSet) bool
func ComparePreRequest ¶
func ComparePreRequest(a, b PreRequest) bool
func CompareProtoFileSpecs ¶
func CompareProtoFileSpecs(a, b ProtoFileSpec) bool
func CompareProtoFiles ¶
func CompareRequests ¶
func CompareSShTunnel ¶
func CompareServerInfo ¶
func CompareServerInfo(a, b ServerInfo) bool
func CompareSettings ¶
func CompareTokenAuth ¶
func EncodeQueryParams ¶
func IsHTTPResponseEmpty ¶
func IsHTTPResponseEmpty(r HTTPResponse) bool
func KeyValuesToText ¶
Types ¶
type APIKeyAuth ¶
func (*APIKeyAuth) Clone ¶
func (a *APIKeyAuth) Clone() *APIKeyAuth
type ActiveWorkspace ¶
type Auth ¶
type Auth struct { Type string `yaml:"type"` BasicAuth *BasicAuth `yaml:"basicAuth,omitempty"` TokenAuth *TokenAuth `yaml:"tokenAuth,omitempty"` APIKeyAuth *APIKeyAuth `yaml:"apiKey,omitempty"` }
type Body ¶
type Collection ¶
type Collection struct { ApiVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` MetaData MetaData `yaml:"metadata"` Spec ColSpec `yaml:"spec"` FilePath string `yaml:"-"` }
func NewCollection ¶
func NewCollection(name string) *Collection
func (*Collection) AddRequest ¶
func (c *Collection) AddRequest(req *Request)
func (*Collection) Clone ¶
func (c *Collection) Clone() *Collection
func (*Collection) FindRequestByID ¶
func (c *Collection) FindRequestByID(id string) *Request
func (*Collection) RemoveRequest ¶
func (c *Collection) RemoveRequest(req *Request)
type Config ¶
type Config struct { ApiVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` MetaData MetaData `yaml:"metadata"` Spec ConfigSpec `yaml:"spec"` }
type ConfigSpec ¶
type ConfigSpec struct {
ActiveWorkspace *ActiveWorkspace `yaml:"activeWorkspace"`
}
type Environment ¶
type Environment struct { ApiVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` MetaData MetaData `yaml:"metadata"` Spec EnvSpec `yaml:"spec"` FilePath string `yaml:"-"` }
func NewEnvironment ¶
func NewEnvironment(name string) *Environment
func (*Environment) ApplyToGRPCRequest ¶
func (e *Environment) ApplyToGRPCRequest(req *GRPCRequestSpec)
func (*Environment) Clone ¶
func (e *Environment) Clone() *Environment
func (*Environment) SetKey ¶
func (e *Environment) SetKey(key string, value string)
type GRPCMethod ¶
type GRPCRequestSpec ¶
type GRPCRequestSpec struct { LasSelectedMethod string `yaml:"lastSelectedMethod"` Metadata []KeyValue `yaml:"metadata"` Auth Auth `yaml:"auth"` ServerInfo ServerInfo `yaml:"serverInfo"` Settings Settings `yaml:"settings"` Body string `yaml:"body"` Services []GRPCService `yaml:"services"` }
func (*GRPCRequestSpec) Clone ¶
func (g *GRPCRequestSpec) Clone() *GRPCRequestSpec
func (*GRPCRequestSpec) HasMethod ¶
func (g *GRPCRequestSpec) HasMethod(method string) bool
type GRPCResponseDetail ¶
type GRPCService ¶
type GRPCService struct { Name string `yaml:"name"` Methods []GRPCMethod }
type HTTPRequest ¶
type HTTPRequest struct { Headers []KeyValue `yaml:"headers"` PathParams []KeyValue `yaml:"pathParams"` QueryParams []KeyValue `yaml:"queryParams"` Body Body `yaml:"body"` Auth Auth `yaml:"auth"` PreRequest PreRequest `yaml:"preRequest"` PostRequest PostRequest `yaml:"postRequest"` }
func (*HTTPRequest) Clone ¶
func (r *HTTPRequest) Clone() *HTTPRequest
type HTTPRequestSpec ¶
type HTTPRequestSpec struct { Method string `yaml:"method"` URL string `yaml:"url"` LastUsedEnvironment LastUsedEnvironment `yaml:"lastUsedEnvironment"` Request *HTTPRequest `yaml:"request"` Responses []HTTPResponse `yaml:"responses"` }
func (*HTTPRequestSpec) Clone ¶
func (h *HTTPRequestSpec) Clone() *HTTPRequestSpec
type HTTPResponse ¶
type HTTPResponseDetail ¶
type KeyValue ¶
type KeyValue struct { ID string `yaml:"id"` Key string `yaml:"key"` Value string `yaml:"value"` Enable bool `yaml:"enable"` }
func MetadataToKeyValue ¶
func ParsePathParams ¶
func ParseQueryParams ¶
type KubernetesTunnel ¶
type LastUsedEnvironment ¶
type PostRequest ¶
type PostRequest struct { Type string `yaml:"type"` Script string `yaml:"script"` PostRequestSet PostRequestSet `yaml:"set"` }
type PostRequestSet ¶
type PreRequest ¶
type PreRequest struct { Type string `yaml:"type"` Script string `yaml:"script"` SShTunnel *SShTunnel `yaml:"sshTunnel,omitempty"` KubernetesTunnel *KubernetesTunnel `yaml:"kubernetesTunnel,omitempty"` }
type PrefSpec ¶
type PrefSpec struct { DarkMode bool `yaml:"darkMode"` SelectedEnvironment SelectedEnvironment `yaml:"selectedEnvironment"` }
type Preferences ¶
type Preferences struct { ApiVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` MetaData MetaData `yaml:"metadata"` Spec PrefSpec `yaml:"spec"` }
func NewPreferences ¶
func NewPreferences() *Preferences
type ProtoFile ¶
type ProtoFile struct { ApiVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` MetaData MetaData `yaml:"metadata"` FilePath string `yaml:"-"` Spec ProtoFileSpec `yaml:"spec"` }
func NewProtoFile ¶
type ProtoFileSpec ¶
type Request ¶
type Request struct { ApiVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` MetaData RequestMeta `yaml:"metadata"` Spec RequestSpec `yaml:"spec"` FilePath string `yaml:"-"` CollectionName string `yaml:"-"` CollectionID string `yaml:"-"` }
func NewGRPCRequest ¶
func NewHTTPRequest ¶
func (*Request) SetDefaultValues ¶
func (r *Request) SetDefaultValues()
func (*Request) SetDefaultValuesForGRPC ¶
func (r *Request) SetDefaultValuesForGRPC()
func (*Request) SetDefaultValuesForHTTP ¶
func (r *Request) SetDefaultValuesForHTTP()
type RequestMeta ¶
type RequestSpec ¶
type RequestSpec struct { GRPC *GRPCRequestSpec `yaml:"grpc,omitempty"` HTTP *HTTPRequestSpec `yaml:"http,omitempty"` }
func (*RequestSpec) Clone ¶
func (r *RequestSpec) Clone() *RequestSpec
type SShTunnel ¶
type SShTunnel struct { Host string `yaml:"host"` Port int `yaml:"port"` User string `yaml:"user"` Password string `yaml:"password"` KeyPath string `yaml:"keyPath"` // The port to be used in the local machine LocalPort int `yaml:"localPort"` TargetPort int `yaml:"targetPort"` Flags []string `yaml:"flags"` }
type SelectedEnvironment ¶
type ServerInfo ¶
Click to show internal directories.
Click to hide internal directories.