extensions

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client struct

func NewClient

func NewClient(config *Config) *Client

NewClient ctor

func (*Client) Delete

func (c *Client) Delete(url string) ([]byte, int, error)

Delete does a put request

func (*Client) Get

func (c *Client) Get(url, body string) ([]byte, int, error)

Get does a get request

func (*Client) Post

func (c *Client) Post(url, body string) ([]byte, int, error)

Post does a post request

func (*Client) Put

func (c *Client) Put(url, body string) ([]byte, int, error)

Put does a put request

type Config

type Config struct {
	Token     string `yaml:"token"`
	ServerURL string `yaml:"serverUrl"`
}

Config struct

func NewConfig

func NewConfig(token, serverURL string) *Config

NewConfig ctor

func ReadConfig

func ReadConfig(fs interfaces.FileSystem, context string) (*Config, error)

ReadConfig from file

func (*Config) Write

func (c *Config) Write(fs interfaces.FileSystem, context string) error

Write the config file to disk

type FileSystem

type FileSystem struct{}

func NewFileSystem

func NewFileSystem() *FileSystem

func (*FileSystem) Create

func (m *FileSystem) Create(name string) (afero.File, error)

Create creates a mock file

func (*FileSystem) IsNotExist

func (m *FileSystem) IsNotExist(err error) bool

IsNotExist returns true if err if of type FileNotExists

func (*FileSystem) MkdirAll

func (m *FileSystem) MkdirAll(path string, perm os.FileMode) error

MkdirAll creates a mock directory

func (*FileSystem) Stat

func (m *FileSystem) Stat(name string) (os.FileInfo, error)

Stat returns the FileInfo describing the the file

Jump to

Keyboard shortcuts

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