cli package - github.com/go-faster/vega/internal/cli - Go Packages

cli

package
v0.0.0-...-6e5e8dc Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigPerm = 0o600

Variables

This section is empty.

Functions

func BoolEnv

func BoolEnv(k string) bool

func Do

func Do(ctx context.Context, client *http.Client, req *http.Request) error

Do is helper for Response that does not return the response.

func Print

func Print(v any) string

Print object as yaml.

func Response

func Response(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error)

Response retries the request until it returns a response with status code 200.

Status codes 400, 401, 422 are considered as permament errors.

func Run

func Run(f func(ctx context.Context) error)

Run runs f.

Types

type Config

type Config struct {
	Token *Token `json:"token"`
}

type Token

type Token struct {
	AccessToken  string    `json:"access_token"`
	RefreshToken string    `json:"refresh_token"`
	ExpiresAt    time.Time `json:"expires_at"`
	ObtainedAt   time.Time `json:"obtained_at"`
}

Jump to

Keyboard shortcuts

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