Documentation
¶
Index ¶
- type Session
- func (s *Session) Delete(path string) (string, error)
- func (s *Session) Get(path string) (string, error)
- func (s *Session) Interactive() error
- func (s *Session) Post(path, body string) (string, error)
- func (s *Session) Put(path, body string) (string, error)
- func (s *Session) Request(method, path, body string, extra map[string]string) (string, error)
- type SessionOption
- type Spec
- type SpecEndpoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
BaseURL string
Auth string
AuthType string
Headers map[string]string
Spec string
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(cfg *config.API, opts ...SessionOption) (*Session, error)
func (*Session) Interactive ¶
type SessionOption ¶ added in v0.19.0
type SessionOption func(*Session)
func WithJqFilter ¶ added in v0.19.0
func WithJqFilter(filter string) SessionOption
WithJqFilter sets a jq filter for the session.
type Spec ¶ added in v0.25.0
type Spec struct {
Title string `json:"title"`
Version string `json:"version"`
Endpoints []SpecEndpoint `json:"endpoints"`
}
Spec represents a parsed OpenAPI specification.
func ParseSpec ¶ added in v0.25.0
ParseSpec reads and parses an OpenAPI/Swagger spec file (YAML or JSON). Returns a structured Spec with all endpoints extracted.
func (*Spec) EndpointsByTag ¶ added in v0.25.0
func (s *Spec) EndpointsByTag() map[string][]SpecEndpoint
EndpointsByTag groups endpoints by their first tag.
func (*Spec) FindEndpoint ¶ added in v0.25.0
func (s *Spec) FindEndpoint(method, path string) *SpecEndpoint
FindEndpoint searches for an endpoint matching the given method and path. Path matching supports both exact match and parameterized paths like /users/{id}.
type SpecEndpoint ¶ added in v0.25.0
type SpecEndpoint struct {
Method string `json:"method"`
Path string `json:"path"`
Summary string `json:"summary,omitempty"`
OperationID string `json:"operation_id,omitempty"`
Tags []string `json:"tags,omitempty"`
}
SpecEndpoint represents a single API endpoint parsed from an OpenAPI spec.
Click to show internal directories.
Click to hide internal directories.