Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionRequest ¶
type ActionRequest struct { // Action - auth/subscribe Action string `json:"action"` Key string `json:"key"` Secret string `json:"secret"` // if action == subscribe Buckets []string `json:"buckets"` }
SubscribeRequest contains bin ID Example authentication: SEND:
{ "action":"auth", "key":"YOUR_KEY" "secret":"YOUR_SECRET" }
Example Subscribe: SEND:
{ "action":"subscribe", "buckets": ["bucket-x", "bucket-uuid-here"] }
func (ActionRequest) MarshalEasyJSON ¶
func (v ActionRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ActionRequest) MarshalJSON ¶
func (v ActionRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ActionRequest) UnmarshalEasyJSON ¶
func (v *ActionRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ActionRequest) UnmarshalJSON ¶
func (v *ActionRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Event ¶
type Event struct { Type string `json:"type"` Meta EventMeta `json:"meta"` Headers map[string][]string `json:"headers"` RawQuery string `json:"query"` Body string `json:"body"` Method string `json:"method"` // combined fields from status Status string `json:"status"` Message string `json:"message"` }
Event is used by the socket server to stream new webhooks, example:
{ "type": "webhook", "meta": { "bucked_id": "1593fe5f-45f9-45cc-ba23-675fdc7c1638", "bucket_name": "123", "input_id": "b90f2fe9-621d-4290-9e74-edd5b61325dd", "input_name": "Default public endpoint" }, "headers": { "Accept": [ "*/*" ], "Content-Length": [ "15" ], "User-Agent": [ "insomnia/6.2.0" ], "Cookie": [ "JSESSIONID.9cbae22a=q3lczkhqmp3s15ssahn1hpsta" ], "Content-Type": [ "application/json" ] }, "query": "foo=bar", "body": "{\"hi\": \"there\"}", "method": "PUT" }
func (Event) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Event) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Event) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Event) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type EventMeta ¶
type EventMeta struct { ID string `json:"id"` BucketID string `json:"bucked_id"` BucketName string `json:"bucket_name"` InputID string `json:"input_id"` InputName string `json:"input_name"` OutputName string `json:"output_name"` OutputDestination string `json:"output_destination"` }
func (EventMeta) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (EventMeta) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*EventMeta) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EventMeta) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type EventStatus ¶
type EventStatus struct { ID string `json:"id"` StatusCode int `json:"status_code"` Retries int `json:"retries"` Message string `json:"message"` }
func (EventStatus) MarshalEasyJSON ¶
func (v EventStatus) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (EventStatus) MarshalJSON ¶
func (v EventStatus) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*EventStatus) UnmarshalEasyJSON ¶
func (v *EventStatus) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EventStatus) UnmarshalJSON ¶
func (v *EventStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type LogUpdateRequest ¶
type LogUpdateRequest struct { ID string `json:"-"` // BucketID string `json:"-"` StatusCode int `json:"status_code"` ResponseBody []byte `json:"response_body"` ResponseHeaders http.Header `json:"response_headers"` Status RequestStatus `json:"status"` Retries int `json:"retries"` }
LogUpdateRequest - update log req
func (LogUpdateRequest) MarshalEasyJSON ¶
func (v LogUpdateRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (LogUpdateRequest) MarshalJSON ¶
func (v LogUpdateRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*LogUpdateRequest) UnmarshalEasyJSON ¶
func (v *LogUpdateRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LogUpdateRequest) UnmarshalJSON ¶
func (v *LogUpdateRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type RequestStatus ¶
type RequestStatus int
RequestStatus - request status
const ( RequestStatusPreparing RequestStatus = iota RequestStatusSent RequestStatusFailed RequestStatusStalled // if request destination wasn't listening - incoming requests will be stalled RequestStatusReceived RequestStatusRejected )
default statuses
func RequestStatusFromCode ¶
func RequestStatusFromCode(code int) RequestStatus
RequestStatusFromCode - gets request status from resp status code
func (RequestStatus) MarshalJSON ¶
func (r RequestStatus) MarshalJSON() ([]byte, error)
MarshalJSON is generated so RequestStatus satisfies json.Marshaler.
func (RequestStatus) String ¶
func (s RequestStatus) String() string
func (*RequestStatus) UnmarshalJSON ¶
func (r *RequestStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON is generated so RequestStatus satisfies json.Unmarshaler.
type VersionInfo ¶
type VersionInfo struct { Name string `json:"name"` BuildDate string `json:"buildDate"` Revision string `json:"revision"` Version string `json:"version"` APIVersion string `json:"apiVersion"` GoVersion string `json:"goVersion"` OS string `json:"os"` Arch string `json:"arch"` KernelVersion string `json:"kernelVersion"` Experimental bool `json:"experimental"` }
VersionInfo describes version and runtime info.
type VersionResponse ¶
type VersionResponse struct { Client *VersionInfo Server *VersionInfo }
func (VersionResponse) ServerOK ¶
func (v VersionResponse) ServerOK() bool
ServerOK returns true when the client could connect to the server and parse the information received. It returns false otherwise.