logtailing

package
v1.19.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Client stripe.RequestPerformer

	// DeviceName is the name of the device sent to Stripe to help identify the device
	DeviceName string

	// Filters for API request logs
	Filters *LogFilters

	// Info, error, etc. logger. Unrelated to API request logs.
	Log *log.Logger

	// Force use of unencrypted ws:// protocol instead of wss://
	NoWSS bool

	// OutCh is the channel to send logs and statuses to for processing in other packages
	OutCh chan websocket.IElement
}

Config provides the configuration of a log tailer

type EventPayload

type EventPayload struct {
	CreatedAt int           `json:"created_at"`
	Livemode  bool          `json:"livemode"`
	Method    string        `json:"method"`
	RequestID string        `json:"request_id"`
	Status    int           `json:"status"`
	URL       string        `json:"url"`
	Error     RedactedError `json:"error"`
}

EventPayload is the mapping for fields in event payloads from request log tailing

type LogFilters

type LogFilters struct {
	FilterAccount        []string `json:"filter_account,omitempty"`
	FilterIPAddress      []string `json:"filter_ip_address,omitempty"`
	FilterHTTPMethod     []string `json:"filter_http_method,omitempty"`
	FilterRequestPath    []string `json:"filter_request_path,omitempty"`
	FilterRequestStatus  []string `json:"filter_request_status,omitempty"`
	FilterSource         []string `json:"filter_source,omitempty"`
	FilterStatusCode     []string `json:"filter_status_code,omitempty"`
	FilterStatusCodeType []string `json:"filter_status_code_type,omitempty"`
}

LogFilters contains all of the potential user-provided filters for log tailing

type RedactedError added in v0.6.11

type RedactedError struct {
	Type         string `json:"type"`
	Charge       string `json:"charge"`
	Code         string `json:"code"`
	DeclineCode  string `json:"decline_code"`
	Message      string `json:"message"`
	Param        string `json:"param"`
	ErrorInsight string `json:"error_insight"`
}

RedactedError is the mapping for fields in error from an EventPayload

type Tailer

type Tailer struct {
	// contains filtered or unexported fields
}

Tailer is the main interface for running the log tailing session

func New

func New(cfg *Config) *Tailer

New creates a new Tailer

func (*Tailer) Run

func (t *Tailer) Run(ctx context.Context) error

Run sets the websocket connection

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL