cli

package
v0.0.0-...-01bb26d Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package used for GO-KMS-CLI

Current version: experimental

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClient

func CreateClient()

Create Client to communicate with GOKMS

func CreateCommands

func CreateCommands(app *cli.Cli)

CreateCommands for the kms

func Exit

func Exit(messages string, errorCode int)

exit will return an error code and the reason to the os

func GetHmac256

func GetHmac256(message string, secret string) string

GetHmac256 will generate a HMAC hash encoded to base64

func OutputMetadata

func OutputMetadata(metadata []kms.KeyMetadata)

OutputMetadata prints a table of metadata to the console

Types

type APIError

type APIError struct {
	StatusCode int // HTTP status code e.g. 200
	Type       string
	Code       string
	Message    string
	RequestID  string
	HostID     string
	Specifics  map[string]string
}

An APIError is an error returned by an AWS API.

func (APIError) Error

func (e APIError) Error() string

type JSONClient

type JSONClient struct {
	Client   *http.Client
	Endpoint string
	// authKey is the key used for authentication
	AuthKey string
}

JSONClient is the underlying client for JSON APIs.

var Client JSONClient

func (*JSONClient) Do

func (c *JSONClient) Do(method, uri string, req, resp interface{}) error

Do sends an HTTP request and returns an HTTP response, following policy (e.g. redirects, cookies, auth) as configured on the client.

func (*JSONClient) SetAuth

func (c *JSONClient) SetAuth(request *http.Request, method string, resource string) *http.Request

SetAuth will set kms auth headers

Jump to

Keyboard shortcuts

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