platform

package
v2.32.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientError

type ClientError struct {
	Err     error
	Details string
}

ClientError define an error when failing to create client

func (*ClientError) Error

func (s *ClientError) Error() string

type Config

type Config struct {
	UserAgent string
}

type Platform

type Platform interface {
	// CreateClient returns a valid client for the current platform
	CreateClient(client *http.Client, configPath string, profileName string) (*scw.Client, error)

	// ScwConfig returns a scaleway config if available, can be nil
	// TODO: remove if possible, currently used in profile completion
	ScwConfig() *scw.Config
	// SetScwConfig set the stored config, useful for testing purpose
	SetScwConfig(cfg *scw.Config)
}

Platform defines an environment running the CLI It can be the implementation to run in a terminal Or the implementation to run in a browser (used for wasm/js build)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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