api

package
v0.0.0-...-c3f5149 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatRequest

func FormatRequest(r *http.Request) string

formatRequest generates ascii representation of a request

func GetResponse

func GetResponse(res *http.Response) ([]byte, error)

Types

type Flush

type Flush struct {
	ReceiptId uuid.UUID `json:"receiptId"`
}

type FlushResponse

type FlushResponse struct {
	FushId uuid.UUID `json:"flushId"`
	Status string    `json: "status"`
}

type Log

type Log struct {
	Timestamp string `json:"timestamp" `
	Message   string `json:"message" `
	Level     string `json:"level" `
	Metadata  string `json:"metadata" `
}

type LogBulk

type LogBulk struct {
	ApplicationId uuid.UUID `json:"applicationId" `
	Tag           string    `json:"tag" `
	Logs          []*Log    `json:"logs" `
}

type LogBulkResponse

type LogBulkResponse struct {
	ApplicationId uuid.UUID `json:"applicationId"`
	LogsCount     int       `json:"logsCount"`
	ReceiptId     uuid.UUID `json:"receiptId"`
	Source        string    `json:"source"`
}

type LogClient

type LogClient struct {
	HttpClient *http.Client
	Url        string
	User       *User
}

func (*LogClient) Flush

func (lc *LogClient) Flush(flush *Flush) (*FlushResponse, error)

func (*LogClient) SendBulk

func (lc *LogClient) SendBulk(logs *LogBulk) (*LogBulkResponse, error)

func (*LogClient) SetHeader

func (lc *LogClient) SetHeader(req *http.Request)

type User

type User struct {
	Id       uuid.UUID
	Email    string
	Password string
}

Jump to

Keyboard shortcuts

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