logdog

package
v0.0.0-...-141b21d Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package logdog contains logic of interacting with Logdog.

Index

Constants

This section is empty.

Variables

View Source
var MockedLogdogClientKey = "mocked logdog client"

Functions

func GetLogFromViewUrl

func GetLogFromViewUrl(c context.Context, viewUrl string) (string, error)

GetLogFromViewUrl gets the log from the log's viewURL

func MockClientContext

func MockClientContext(c context.Context, data map[string]string) context.Context

Types

type Client

type Client interface {
	GetLog(c context.Context, viewUrl string) (string, error)
}

We need the interface for testing purpose

func GetClient

func GetClient(c context.Context) Client

type LogdogClient

type LogdogClient struct{}

func (*LogdogClient) GetLog

func (cl *LogdogClient) GetLog(c context.Context, viewUrl string) (string, error)

type MockedLogdogClient

type MockedLogdogClient struct {
	Data map[string]string // Data for MockedLogdogClient to return
}

func (*MockedLogdogClient) GetLog

func (cl *MockedLogdogClient) GetLog(c context.Context, viewUrl string) (string, error)

func (*MockedLogdogClient) SetData

func (cl *MockedLogdogClient) SetData(data map[string]string)

Jump to

Keyboard shortcuts

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