Documentation ¶
Index ¶
- Variables
- func HTTPHandler(resolver *Resolver, gqlEndpoint string) http.Handler
- func MarshalULID(u ulid.ULID) graphql.Marshaler
- func MarshalURL(u *url.URL) graphql.Marshaler
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func UnmarshalULID(v interface{}) (ulid.ULID, error)
- func UnmarshalURL(v interface{}) (*url.URL, error)
- type CancelRequestResult
- type CancelResponseResult
- type ClearHTTPRequestLogResult
- type CloseProjectResult
- type ComplexityRoot
- type Config
- type DeleteProjectResult
- type DeleteSenderRequestsResult
- type DirectiveRoot
- type HTTPHeader
- type HTTPHeaderInput
- type HTTPMethod
- type HTTPProtocol
- type HTTPRequest
- type HTTPRequestLog
- type HTTPRequestLogFilter
- type HTTPRequestLogFilterInput
- type HTTPResponse
- type HTTPResponseLog
- type InterceptSettings
- type ModifyRequestInput
- type ModifyRequestResult
- type ModifyResponseInput
- type ModifyResponseResult
- type MutationResolver
- type Project
- type ProjectSettings
- type QueryResolver
- type Resolver
- type ResolverRoot
- type ScopeHeader
- type ScopeHeaderInput
- type ScopeRule
- type ScopeRuleInput
- type SenderRequest
- type SenderRequestFilter
- type SenderRequestFilterInput
- type SenderRequestInput
- type UpdateInterceptSettingsInput
Constants ¶
This section is empty.
Variables ¶
View Source
var AllHTTPMethod = []HTTPMethod{ HTTPMethodGet, HTTPMethodHead, HTTPMethodPost, HTTPMethodPut, HTTPMethodDelete, HTTPMethodConnect, HTTPMethodOptions, HTTPMethodTrace, HTTPMethodPatch, }
View Source
var AllHTTPProtocol = []HTTPProtocol{ HTTPProtocolHTTP10, HTTPProtocolHTTP11, HTTPProtocolHTTP20, }
Functions ¶
func HTTPHandler ¶ added in v0.6.0
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func UnmarshalULID ¶ added in v0.5.0
func UnmarshalURL ¶ added in v0.5.0
Types ¶
type CancelRequestResult ¶ added in v0.7.0
type CancelRequestResult struct {
Success bool `json:"success"`
}
type CancelResponseResult ¶ added in v0.7.0
type CancelResponseResult struct {
Success bool `json:"success"`
}
type ClearHTTPRequestLogResult ¶ added in v0.3.0
type ClearHTTPRequestLogResult struct {
Success bool `json:"success"`
}
type CloseProjectResult ¶ added in v0.2.0
type CloseProjectResult struct {
Success bool `json:"success"`
}
type ComplexityRoot ¶
type ComplexityRoot struct { CancelRequestResult struct { Success func(childComplexity int) int } CancelResponseResult struct { Success func(childComplexity int) int } ClearHTTPRequestLogResult struct { Success func(childComplexity int) int } CloseProjectResult struct { Success func(childComplexity int) int } DeleteProjectResult struct { Success func(childComplexity int) int } DeleteSenderRequestsResult struct { Success func(childComplexity int) int } HTTPHeader struct { Key func(childComplexity int) int Value func(childComplexity int) int } HTTPRequest struct { Body func(childComplexity int) int Headers func(childComplexity int) int ID func(childComplexity int) int Method func(childComplexity int) int Proto func(childComplexity int) int Response func(childComplexity int) int URL func(childComplexity int) int } HTTPRequestLog struct { Body func(childComplexity int) int Headers func(childComplexity int) int ID func(childComplexity int) int Method func(childComplexity int) int Proto func(childComplexity int) int Response func(childComplexity int) int Timestamp func(childComplexity int) int URL func(childComplexity int) int } HTTPRequestLogFilter struct { OnlyInScope func(childComplexity int) int SearchExpression func(childComplexity int) int } HTTPResponse struct { Body func(childComplexity int) int Headers func(childComplexity int) int ID func(childComplexity int) int Proto func(childComplexity int) int StatusCode func(childComplexity int) int StatusReason func(childComplexity int) int } HTTPResponseLog struct { Body func(childComplexity int) int Headers func(childComplexity int) int ID func(childComplexity int) int Proto func(childComplexity int) int StatusCode func(childComplexity int) int StatusReason func(childComplexity int) int } InterceptSettings struct { RequestFilter func(childComplexity int) int RequestsEnabled func(childComplexity int) int ResponseFilter func(childComplexity int) int ResponsesEnabled func(childComplexity int) int } ModifyRequestResult struct { Success func(childComplexity int) int } ModifyResponseResult struct { Success func(childComplexity int) int } Mutation struct { CancelRequest func(childComplexity int, id ulid.ULID) int CancelResponse func(childComplexity int, requestID ulid.ULID) int ClearHTTPRequestLog func(childComplexity int) int CloseProject func(childComplexity int) int CreateOrUpdateSenderRequest func(childComplexity int, request SenderRequestInput) int CreateProject func(childComplexity int, name string) int CreateSenderRequestFromHTTPRequestLog func(childComplexity int, id ulid.ULID) int DeleteProject func(childComplexity int, id ulid.ULID) int DeleteSenderRequests func(childComplexity int) int ModifyRequest func(childComplexity int, request ModifyRequestInput) int ModifyResponse func(childComplexity int, response ModifyResponseInput) int OpenProject func(childComplexity int, id ulid.ULID) int SendRequest func(childComplexity int, id ulid.ULID) int SetHTTPRequestLogFilter func(childComplexity int, filter *HTTPRequestLogFilterInput) int SetScope func(childComplexity int, scope []ScopeRuleInput) int SetSenderRequestFilter func(childComplexity int, filter *SenderRequestFilterInput) int UpdateInterceptSettings func(childComplexity int, input UpdateInterceptSettingsInput) int } Project struct { ID func(childComplexity int) int IsActive func(childComplexity int) int Name func(childComplexity int) int Settings func(childComplexity int) int } ProjectSettings struct { Intercept func(childComplexity int) int } Query struct { ActiveProject func(childComplexity int) int HTTPRequestLog func(childComplexity int, id ulid.ULID) int HTTPRequestLogFilter func(childComplexity int) int HTTPRequestLogs func(childComplexity int) int InterceptedRequest func(childComplexity int, id ulid.ULID) int InterceptedRequests func(childComplexity int) int Projects func(childComplexity int) int Scope func(childComplexity int) int SenderRequest func(childComplexity int, id ulid.ULID) int SenderRequests func(childComplexity int) int } ScopeHeader struct { Key func(childComplexity int) int Value func(childComplexity int) int } ScopeRule struct { Body func(childComplexity int) int Header func(childComplexity int) int URL func(childComplexity int) int } SenderRequest struct { Body func(childComplexity int) int Headers func(childComplexity int) int ID func(childComplexity int) int Method func(childComplexity int) int Proto func(childComplexity int) int Response func(childComplexity int) int SourceRequestLogID func(childComplexity int) int Timestamp func(childComplexity int) int URL func(childComplexity int) int } SenderRequestFilter struct { OnlyInScope func(childComplexity int) int SearchExpression func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DeleteProjectResult ¶ added in v0.2.0
type DeleteProjectResult struct {
Success bool `json:"success"`
}
type DeleteSenderRequestsResult ¶ added in v0.5.0
type DeleteSenderRequestsResult struct {
Success bool `json:"success"`
}
type DirectiveRoot ¶
type DirectiveRoot struct { }
type HTTPHeader ¶
type HTTPHeaderInput ¶ added in v0.5.0
type HTTPMethod ¶
type HTTPMethod string
const ( HTTPMethodGet HTTPMethod = "GET" HTTPMethodHead HTTPMethod = "HEAD" HTTPMethodPost HTTPMethod = "POST" HTTPMethodPut HTTPMethod = "PUT" HTTPMethodDelete HTTPMethod = "DELETE" HTTPMethodConnect HTTPMethod = "CONNECT" HTTPMethodOptions HTTPMethod = "OPTIONS" HTTPMethodTrace HTTPMethod = "TRACE" HTTPMethodPatch HTTPMethod = "PATCH" )
func (HTTPMethod) IsValid ¶
func (e HTTPMethod) IsValid() bool
func (HTTPMethod) MarshalGQL ¶
func (e HTTPMethod) MarshalGQL(w io.Writer)
func (HTTPMethod) String ¶
func (e HTTPMethod) String() string
func (*HTTPMethod) UnmarshalGQL ¶
func (e *HTTPMethod) UnmarshalGQL(v interface{}) error
type HTTPProtocol ¶ added in v0.5.0
type HTTPProtocol string
const ( HTTPProtocolHTTP10 HTTPProtocol = "HTTP10" HTTPProtocolHTTP11 HTTPProtocol = "HTTP11" HTTPProtocolHTTP20 HTTPProtocol = "HTTP20" )
func (HTTPProtocol) IsValid ¶ added in v0.5.0
func (e HTTPProtocol) IsValid() bool
func (HTTPProtocol) MarshalGQL ¶ added in v0.5.0
func (e HTTPProtocol) MarshalGQL(w io.Writer)
func (HTTPProtocol) String ¶ added in v0.5.0
func (e HTTPProtocol) String() string
func (*HTTPProtocol) UnmarshalGQL ¶ added in v0.5.0
func (e *HTTPProtocol) UnmarshalGQL(v interface{}) error
type HTTPRequest ¶ added in v0.7.0
type HTTPRequest struct { ID ulid.ULID `json:"id"` URL *url.URL `json:"url"` Method HTTPMethod `json:"method"` Proto HTTPProtocol `json:"proto"` Headers []HTTPHeader `json:"headers"` Body *string `json:"body"` Response *HTTPResponse `json:"response"` }
type HTTPRequestLog ¶
type HTTPRequestLog struct { ID ulid.ULID `json:"id"` URL string `json:"url"` Method HTTPMethod `json:"method"` Proto string `json:"proto"` Headers []HTTPHeader `json:"headers"` Body *string `json:"body"` Timestamp time.Time `json:"timestamp"` Response *HTTPResponseLog `json:"response"` }
type HTTPRequestLogFilter ¶ added in v0.2.0
type HTTPRequestLogFilterInput ¶ added in v0.2.0
type HTTPResponse ¶ added in v0.7.0
type HTTPResponse struct { // Will be the same ID as its related request ID. ID ulid.ULID `json:"id"` Proto HTTPProtocol `json:"proto"` StatusCode int `json:"statusCode"` StatusReason string `json:"statusReason"` Body *string `json:"body"` Headers []HTTPHeader `json:"headers"` }
type HTTPResponseLog ¶
type HTTPResponseLog struct { // Will be the same ID as its related request ID. ID ulid.ULID `json:"id"` Proto HTTPProtocol `json:"proto"` StatusCode int `json:"statusCode"` StatusReason string `json:"statusReason"` Body *string `json:"body"` Headers []HTTPHeader `json:"headers"` }
type InterceptSettings ¶ added in v0.7.0
type ModifyRequestInput ¶ added in v0.7.0
type ModifyRequestInput struct { ID ulid.ULID `json:"id"` URL *url.URL `json:"url"` Method HTTPMethod `json:"method"` Proto HTTPProtocol `json:"proto"` Headers []HTTPHeaderInput `json:"headers"` Body *string `json:"body"` ModifyResponse *bool `json:"modifyResponse"` }
type ModifyRequestResult ¶ added in v0.7.0
type ModifyRequestResult struct {
Success bool `json:"success"`
}
type ModifyResponseInput ¶ added in v0.7.0
type ModifyResponseInput struct { RequestID ulid.ULID `json:"requestID"` Proto HTTPProtocol `json:"proto"` Headers []HTTPHeaderInput `json:"headers"` Body *string `json:"body"` StatusCode int `json:"statusCode"` StatusReason string `json:"statusReason"` }
type ModifyResponseResult ¶ added in v0.7.0
type ModifyResponseResult struct {
Success bool `json:"success"`
}
type MutationResolver ¶ added in v0.2.0
type MutationResolver interface { CreateProject(ctx context.Context, name string) (*Project, error) OpenProject(ctx context.Context, id ulid.ULID) (*Project, error) CloseProject(ctx context.Context) (*CloseProjectResult, error) DeleteProject(ctx context.Context, id ulid.ULID) (*DeleteProjectResult, error) ClearHTTPRequestLog(ctx context.Context) (*ClearHTTPRequestLogResult, error) SetScope(ctx context.Context, scope []ScopeRuleInput) ([]ScopeRule, error) SetHTTPRequestLogFilter(ctx context.Context, filter *HTTPRequestLogFilterInput) (*HTTPRequestLogFilter, error) SetSenderRequestFilter(ctx context.Context, filter *SenderRequestFilterInput) (*SenderRequestFilter, error) CreateOrUpdateSenderRequest(ctx context.Context, request SenderRequestInput) (*SenderRequest, error) CreateSenderRequestFromHTTPRequestLog(ctx context.Context, id ulid.ULID) (*SenderRequest, error) SendRequest(ctx context.Context, id ulid.ULID) (*SenderRequest, error) DeleteSenderRequests(ctx context.Context) (*DeleteSenderRequestsResult, error) ModifyRequest(ctx context.Context, request ModifyRequestInput) (*ModifyRequestResult, error) CancelRequest(ctx context.Context, id ulid.ULID) (*CancelRequestResult, error) ModifyResponse(ctx context.Context, response ModifyResponseInput) (*ModifyResponseResult, error) CancelResponse(ctx context.Context, requestID ulid.ULID) (*CancelResponseResult, error) UpdateInterceptSettings(ctx context.Context, input UpdateInterceptSettingsInput) (*InterceptSettings, error) }
type Project ¶ added in v0.2.0
type Project struct { ID ulid.ULID `json:"id"` Name string `json:"name"` IsActive bool `json:"isActive"` Settings *ProjectSettings `json:"settings"` }
type ProjectSettings ¶ added in v0.7.0
type ProjectSettings struct {
Intercept *InterceptSettings `json:"intercept"`
}
type QueryResolver ¶
type QueryResolver interface { HTTPRequestLog(ctx context.Context, id ulid.ULID) (*HTTPRequestLog, error) HTTPRequestLogs(ctx context.Context) ([]HTTPRequestLog, error) HTTPRequestLogFilter(ctx context.Context) (*HTTPRequestLogFilter, error) ActiveProject(ctx context.Context) (*Project, error) Projects(ctx context.Context) ([]Project, error) Scope(ctx context.Context) ([]ScopeRule, error) SenderRequest(ctx context.Context, id ulid.ULID) (*SenderRequest, error) SenderRequests(ctx context.Context) ([]SenderRequest, error) InterceptedRequests(ctx context.Context) ([]HTTPRequest, error) InterceptedRequest(ctx context.Context, id ulid.ULID) (*HTTPRequest, error) }
type Resolver ¶
type Resolver struct { ProjectService proj.Service RequestLogService reqlog.Service InterceptService *intercept.Service SenderService sender.Service }
func (*Resolver) Mutation ¶ added in v0.2.0
func (r *Resolver) Mutation() MutationResolver
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
type ResolverRoot ¶
type ResolverRoot interface { Mutation() MutationResolver Query() QueryResolver }
type ScopeHeader ¶ added in v0.2.0
type ScopeHeaderInput ¶ added in v0.2.0
type ScopeRule ¶ added in v0.2.0
type ScopeRule struct { URL *string `json:"url"` Header *ScopeHeader `json:"header"` Body *string `json:"body"` }
type ScopeRuleInput ¶ added in v0.2.0
type ScopeRuleInput struct { URL *string `json:"url"` Header *ScopeHeaderInput `json:"header"` Body *string `json:"body"` }
type SenderRequest ¶ added in v0.5.0
type SenderRequest struct { ID ulid.ULID `json:"id"` SourceRequestLogID *ulid.ULID `json:"sourceRequestLogID"` URL *url.URL `json:"url"` Method HTTPMethod `json:"method"` Proto HTTPProtocol `json:"proto"` Headers []HTTPHeader `json:"headers"` Body *string `json:"body"` Timestamp time.Time `json:"timestamp"` Response *HTTPResponseLog `json:"response"` }
type SenderRequestFilter ¶ added in v0.5.0
type SenderRequestFilterInput ¶ added in v0.5.0
type SenderRequestInput ¶ added in v0.5.0
type SenderRequestInput struct { ID *ulid.ULID `json:"id"` URL *url.URL `json:"url"` Method *HTTPMethod `json:"method"` Proto *HTTPProtocol `json:"proto"` Headers []HTTPHeaderInput `json:"headers"` Body *string `json:"body"` }
Click to show internal directories.
Click to hide internal directories.