storage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElasticStorage

type ElasticStorage struct {
	ES *elasticsearch.Client
}

ElasticStorage is the backend Storage interface that works with Elasticsearch

func (ElasticStorage) Store

func (s ElasticStorage) Store(l Log) error

Store is the action of storing

type Log

type Log struct {
	URL                         string              `json:"url"`
	Headers                     map[string][]string `json:"headers"`
	MainUpstreamStatusCode      int                 `json:"main_upstream_status_code"`
	TestUpstreamStatusCode      int                 `json:"test_upstream_status_code"`
	MainUpstreamResponsePayload *string             `json:"main_upstream_response_payload"`
	TestUpstreamResponsePayload *string             `json:"test_upstream_response_payload"`
}

Log defines the structure of records storing in Storage as log of requests

type Storage

type Storage interface {
	// Store is the action of storing
	Store(Log) error
}

Storage defines the behavior of log storage

Jump to

Keyboard shortcuts

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