client

package
v0.0.0-...-7f91efa Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POST = "POST"
	GET  = "GET"

	API_AUTH_HOST = "https://identity.tyo1.conoha.io/v2.0"
	API_HOST      = "https://compute.tyo1.conoha.io/v2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Auth(ctx context.Context) (model.AuthRes, error)
}

type ConohaClient

type ConohaClient struct {
	AuthURL    *url.URL
	ApiURL     *url.URL
	HTTPClient *http.Client

	UserName string
	Password string

	TenantID string
	ServerID string

	Logger *zap.Logger
}

func NewConohaClient

func NewConohaClient(l *zap.Logger) (*ConohaClient, error)

func (*ConohaClient) Auth

func (c *ConohaClient) Auth(ctx context.Context) (*model.AuthRes, error)

func (*ConohaClient) Boot

func (c *ConohaClient) Boot(ctx context.Context, authRes *model.AuthRes) error

func (*ConohaClient) Halt

func (c *ConohaClient) Halt(ctx context.Context, authRes *model.AuthRes) error

Jump to

Keyboard shortcuts

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