cloudwatchlogurl

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 6 Imported by: 0

README

CloudWatch Log URLs

Go Reference

This package implements the bespoke escaping/encoding used to build urls for CloudWatch Logs.

Credit: https://stackoverflow.com/a/68638660/215969

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EcmaEscape

func EcmaEscape(s string) string

EcmaEscape is an implementation of javascript's deprecated escape() function

func FragmentEscape

func FragmentEscape(s string) string

FragmentEscape escapes a string for use in aws url fragments

func GroupURL

func GroupURL(region, group string) string

GroupURL returns a url for the provided region and log group

func InsightsURL

func InsightsURL(region string, opt InsightsOptions) string

func QueryEscape

func QueryEscape(s string) string

Go's url.QueryEscape differes from javascript's encodeURIComponent. It does follow the spec, but it causes issues with the aws urls.

func StreamURL

func StreamURL(region, group, stream string) string

StreamURL returns a url for the provided region, log group, and stream name.

Types

type InsightsOptions

type InsightsOptions struct {
	Groups []string
	Query  string
	Age    time.Duration
	Live   bool
}

type QueryDetails

type QueryDetails map[string][]string

QueryDetails encodes key/value pairs into the format used in aws log insights urls.

func (QueryDetails) Add

func (q QueryDetails) Add(key, value string, quote bool)

Add a value to the specified key. The quote parameter indicates if the provided value should be quoted.

func (QueryDetails) Encode

func (q QueryDetails) Encode() string

Encode returns the key/values as an encoded string.

Jump to

Keyboard shortcuts

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