logs

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package logs provides a client for retrieving and displaying logs from the SWO API.

Index

Constants

View Source
const (
	ConfigContextKey  = "config"
	GroupContextKey   = "group"
	SystemContextKey  = "system"
	MaxTimeContextKey = "max-time"
	MinTimeContextKey = "min-time"
	JSONContextKey    = "json"
	FollowContextKey  = "follow"
)

Context keys for command line flags

Variables

View Source
var (
	// ErrInvalidAPIResponse indicates a non-2xx status code was received from the API
	ErrInvalidAPIResponse = errors.New("received non-2xx status code")
	// ErrInvalidDateTime indicates a timestamp could not be parsed
	ErrInvalidDateTime = errors.New("could not parse timestamp")
	// ErrNoContent indicates an empty response body was received from the API
	ErrNoContent = errors.New("no content")
)

Functions

func NewGetCommand added in v1.3.0

func NewGetCommand() *cli.Command

NewGetCommand creates a new 'logs get' command

func NewLogsCommand

func NewLogsCommand() *cli.Command

NewLogsCommand creates a new 'logs' command

Types

type Client

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

Client is a logs client

func NewClient

func NewClient(opts *Options) (*Client, error)

NewClient creates a new logs client

func (*Client) Run

func (c *Client) Run(ctx context.Context) error

Run executes the logs retrieval and printing process

type Options

type Options struct {
	Token  string
	APIURL string
	// contains filtered or unexported fields
}

Options represents the command line options for the logs command

func (*Options) Init

func (opts *Options) Init(args []string) error

Init initializes the options by parsing and validating the time flags

Jump to

Keyboard shortcuts

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