monasca

package
v1.2.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMonascaSink

func CreateMonascaSink(uri *url.URL) (core.DataSink, error)

CreateMonascaSink creates a monasca sink that can consume the Monasca APIs to create metrics.

Types

type Client

type Client interface {
	SendRequest(method, path string, request interface{}) (int, string, error)
	GetURL() *url.URL
	CheckHealth() bool
}

Client specifies the methods of any client ot the Monasca API

func NewMonascaClient

func NewMonascaClient(config Config) (Client, error)

NewMonascaClient creates a monasca client.

type ClientImpl

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

ClientImpl implements the monasca API client interface.

func (*ClientImpl) CheckHealth

func (monClient *ClientImpl) CheckHealth() bool

CheckHealth of the monasca API server.

func (*ClientImpl) GetURL

func (monClient *ClientImpl) GetURL() *url.URL

GetURL of the Monasca API server.

func (*ClientImpl) SendRequest

func (monClient *ClientImpl) SendRequest(method, path string, request interface{}) (int, string, error)

SendRequest to the Monasca API, authenticating on the fly. Returns 0, "", err if the request cannot be built. Returns statusCode, response, nil if communication with the server was OK.

type Config

type Config struct {
	gophercloud.AuthOptions
	MonascaURL string
}

Config represents the configuration of the Monasca sink.

func NewConfig

func NewConfig(opts url.Values) Config

NewConfig builds a configuration object from the parameters of the monasca sink.

type KeystoneClient

type KeystoneClient interface {
	MonascaURL() (*url.URL, error)
	GetToken() (string, error)
}

KeystoneClient defines the interface of any client that can talk with Keystone.

func NewKeystoneClient

func NewKeystoneClient(config Config) (KeystoneClient, error)

NewKeystoneClient initilizes a keystone client with the provided configuration.

type KeystoneClientImpl

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

KeystoneClientImpl can authenticate with keystone and provide tokens, required for accessing the Monasca APIs.

func (*KeystoneClientImpl) GetToken

func (ksClient *KeystoneClientImpl) GetToken() (string, error)

GetToken returns a valid X-Auth-Token.

func (*KeystoneClientImpl) MonascaURL

func (ksClient *KeystoneClientImpl) MonascaURL() (*url.URL, error)

MonascaURL Discovers the monasca service API endpoint and returns it.

Jump to

Keyboard shortcuts

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