cockpit

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: Unlicense Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCockpitNotActivated = fmt.Errorf("cockpit: cockpit not activated")

ErrCockpitNotActivated is returned when the cockpit is not activated for a project.

Functions

This section is empty.

Types

type Cockpit

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

func NewCockpit

func NewCockpit(logger *slog.Logger, scwClient *scw.Client) *Cockpit

func (*Cockpit) Logs

func (c *Cockpit) Logs(ctx context.Context, r resource.Resource) ([]resource.Log, error)

type Entry

type Entry struct {
	Timestamp time.Time
	Line      string
}

func (*Entry) UnmarshalJSON

func (e *Entry) UnmarshalJSON(data []byte) error

type QueryResponse

type QueryResponse struct {
	Status string            `json:"status"`
	Data   QueryResponseData `json:"data"`
}

type QueryResponseData

type QueryResponseData struct {
	ResultType string `json:"resultType"`
	// We only support stream result type for now.
	Result Streams `json:"result"`
}

type Stream

type Stream struct {
	Stream  StreamMetadata `json:"stream"`
	Entries []Entry        `json:"values"`
}

type StreamMetadata

type StreamMetadata struct {
	ResourceID   string `json:"resource_id"`
	ResourceName string `json:"resource_name"`
	ResourceType string `json:"resource_type"`
}

type Streams

type Streams []Stream

Jump to

Keyboard shortcuts

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