client

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotUseGuest = errors.New("cannot use guest client for this operation")
View Source
var ErrInvalidClient = errors.New("invalid client")

Functions

This section is empty.

Types

type AuthorizedRoundTripper

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

func (*AuthorizedRoundTripper) RoundTrip

func (a *AuthorizedRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

type Client

type Client interface {
	WhoAmI(ctx context.Context) (string, error)
	GenerateRunbookV2(ctx context.Context, commands []RecordedCommand) (*GeneratedRunbook, error)
	// Deprecated. Use GenerateRunbookV2 instead
	GenerateRunbook(ctx context.Context, commands []string) (*GeneratedRunbook, error)
	RunbookByID(ctx context.Context, id string) (*Runbook, error)
	Runbooks(ctx context.Context) ([]RunbookInfo, error)
	Ask(ctx context.Context, question QuestionInfo) (*Runbook, error)
}

func New

func New() (Client, error)

func NewGuest added in v0.9.0

func NewGuest() Client

type ErrorResponse added in v0.9.0

type ErrorResponse struct {
	Message string `json:"message"`
}

type GeneratedRunbook

type GeneratedRunbook struct {
	Runbook Runbook `json:"runbook"`
	URL     string  `json:"url"`
}

type GuestRoundTripper added in v0.9.0

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

func (*GuestRoundTripper) RoundTrip added in v0.9.0

func (g *GuestRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

type QuestionInfo added in v0.9.5

type QuestionInfo struct {
	Question string            `json:"question"`
	Tags     map[string]string `json:"tags,omitempty"`
}

type RecordedCommand added in v0.8.2

type RecordedCommand struct {
	Command string `json:"command"`
	Prompt  string `json:"prompt,omitempty"`
}

type Runbook

type Runbook struct {
	RunbookID string `json:"runbook_id"`
	Title     string `json:"title"`
	Steps     []Step `json:"steps"`
}

func (*Runbook) Commands added in v0.9.0

func (rb *Runbook) Commands() []string

type RunbookInfo added in v0.9.1

type RunbookInfo struct {
	RunbookID string `json:"runbook_id"`
	Title     string `json:"title"`
}

type Step

type Step struct {
	Description string `json:"description"`
	Command     string `json:"command"`
}

Jump to

Keyboard shortcuts

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