Documentation ¶
Index ¶
- Variables
- type Method
- type Options
- type Protocol
- type Prototype
- func (p *Prototype) Clone() *Prototype
- func (p *Prototype) ContentLength() int64
- func (p *Prototype) ContentType() string
- func (p *Prototype) ExcludesHeader(k string) bool
- func (p *Prototype) FinalHeaders(sess *session.Session) header.Headers
- func (p *Prototype) FullPathString() string
- func (p *Prototype) GetCookies() header.Cookies
- func (p *Prototype) Host() string
- func (p *Prototype) Merge(data npncore.Data, logger *logrus.Logger) *Prototype
- func (p *Prototype) Minify() *Prototype
- func (p *Prototype) Normalize() *Prototype
- func (p *Prototype) SetCookies(cookies header.Cookies)
- func (p *Prototype) ToHTTP(sess *session.Session) *http.Request
- func (p *Prototype) Trim()
- func (p *Prototype) URL() *url.URL
- func (p *Prototype) URLParts() []*URLPart
- func (p *Prototype) URLString() string
- type Request
- type Requests
- type Service
- func (s *Service) Delete(userID *uuid.UUID, coll string, key string) error
- func (s *Service) List(userID *uuid.UUID, c string) (Summaries, error)
- func (s *Service) Load(userID *uuid.UUID, c string, f string) (*Request, error)
- func (s *Service) LoadAll(userID *uuid.UUID, c string) (Requests, error)
- func (s *Service) Save(userID *uuid.UUID, coll string, originalKey string, req *Request) error
- type Summaries
- type Summary
- type URLPart
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MethodGet = Method{Key: http.MethodGet, Description: ""} MethodHead = Method{Key: http.MethodHead, Description: ""} MethodPost = Method{Key: http.MethodPost, Description: ""} MethodPut = Method{Key: http.MethodPut, Description: ""} MethodPatch = Method{Key: http.MethodPatch, Description: ""} MethodDelete = Method{Key: http.MethodDelete, Description: ""} MethodConnect = Method{Key: http.MethodConnect, Description: ""} MethodOptions = Method{Key: http.MethodOptions, Description: ""} MethodTrace = Method{Key: http.MethodTrace, Description: ""} )
View Source
var ( ProtocolHTTP = Protocol{Key: "http", Description: ""} ProtocolHTTPS = Protocol{Key: "https", Description: ""} ProtocolWS = Protocol{Key: "ws", Description: ""} ProtocolWSS = Protocol{Key: "wss", Description: ""} )
View Source
var AllMethods = []Method{MethodGet, MethodHead, MethodPost, MethodPut, MethodPatch, MethodDelete, MethodConnect, MethodOptions, MethodTrace}
View Source
var AllProtocols = []Protocol{ProtocolHTTP, ProtocolHTTPS, ProtocolWS, ProtocolWSS}
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { Timeout int `json:"timeout,omitempty"` IgnoreRedirects bool `json:"ignoreRedirects,omitempty"` IgnoreReferrer bool `json:"ignoreReferrer,omitempty"` IgnoreCerts bool `json:"ignoreCerts,omitempty"` IgnoreCookies bool `json:"ignoreCookies,omitempty"` ExcludeDefaultHeaders []string `json:"excludeDefaultHeaders,omitempty"` ReadCookieJars []string `json:"readCookieJars,omitempty"` WriteCookieJar string `json:"writeCookieJar,omitempty"` SSLCert string `json:"sslCert,omitempty"` UserAgentOverride string `json:"userAgentOverride,omitempty"` }
type Protocol ¶
func ProtocolFromString ¶
func (*Protocol) MarshalJSON ¶
func (*Protocol) UnmarshalJSON ¶
type Prototype ¶
type Prototype struct { Method Method `json:"method"` Protocol Protocol `json:"protocol"` Domain string `json:"domain"` Port int `json:"port,omitempty"` Path string `json:"path,omitempty"` Query npncontroller.QueryParams `json:"query,omitempty"` Fragment string `json:"fragment,omitempty"` Headers header.Headers `json:"headers,omitempty"` Auth *auth.Auth `json:"auth,omitempty"` Body *body.Body `json:"body,omitempty"` Options *Options `json:"options,omitempty"` }
func NewPrototype ¶
func NewPrototype() *Prototype
func PrototypeFromString ¶
func PrototypeFromURL ¶
func (*Prototype) ContentLength ¶
func (*Prototype) ContentType ¶
func (*Prototype) ExcludesHeader ¶
func (*Prototype) FinalHeaders ¶
func (*Prototype) FullPathString ¶
func (*Prototype) GetCookies ¶
func (*Prototype) SetCookies ¶
type Request ¶
type Request struct { Key string `json:"key,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Prototype *Prototype `json:"prototype"` }
func (*Request) TitleWithFallback ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
Click to show internal directories.
Click to hide internal directories.