houston

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: Apache-2.0 Imports: 7 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *httputil.HTTPClient
}

Client containers the logger and HTTPClient used to communicate with the HoustonAPI

func NewHoustonClient

func NewHoustonClient(c *httputil.HTTPClient) *Client

NewHoustonClient returns a new Client with the logger and HTTP client setup.

func (*Client) CreateDeployment

func (c *Client) CreateDeployment(title string) (*StatusResponse, error)

CreateDeployment will send request to Houston to create a new AirflowDeployment Returns a StatusResponse which contains the unique id of deployment

func (*Client) CreateToken

func (c *Client) CreateToken(email string, password string) (*Token, error)

CreateToken will request a new token from Houston, passing the users e-mail and password. Returns a Token structure with the users ID and Token inside.

func (*Client) FetchDeployment

func (c *Client) FetchDeployment(deploymentUuid string) (*Deployment, error)

FetchDeployment will request a specific airflow deployments from Houston by uuid Returns a Deployment structure with deployment details

func (*Client) FetchDeployments

func (c *Client) FetchDeployments() ([]Deployment, error)

FetchDeployments will request all airflow deployments from Houston Returns a []Deployment structure with deployment details

func (*Client) QueryHouston

func (c *Client) QueryHouston(query string) (*HoustonResponse, error)

QueryHouston executes a query against the Houston API

type CreateTokenResponse

type CreateTokenResponse struct {
	Data struct {
		CreateToken Token `json:"createToken"`
	} `json:"data"`
}

CreateTokenResponse defines structure of a houston response CreateTokenResponse object

type Decoded

type Decoded struct {
	ID  string `json:"id"`
	SU  bool   `json:"sU"`
	Iat int    `json:"iat"`
	Exp int    `json:"exp"`
}

Decoded defines structure of a houston response Decoded object

type Deployment

type Deployment struct {
	Id          string `json:"uuid"`
	Type        string `json:"type"`
	Title       string `json:"title"`
	ReleaseName string `json:"release_name"`
	Version     string `json:"version"`
}

Deployment defines structure of a houston response Deployment object

type FetchDeploymentsResponse

type FetchDeploymentsResponse struct {
	Data struct {
		FetchDeployments []Deployment `json:"fetchDeployments"`
	} `json:"data"`
}

FetchDeploymentsResponse defines structure of a houston response FetchDeploymentsResponse object

type GraphQLQuery

type GraphQLQuery struct {
	Query string `json:"query"`
}

GraphQLQuery wraps a graphql query string

type HoustonResponse

type HoustonResponse struct {
	Data struct {
		CreateDeployment *StatusResponse `json:"createDeployment,omitempty"`
		CreateToken      *Token          `json:"createToken,omitempty"`
		FetchDeployments []Deployment    `json:"fetchDeployments"`
	} `json:"data"`
}

HoustonReasponse wraps all houston response structs used for json marashalling

type StatusResponse

type StatusResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Code    string `json:"code"`
	Id      string `json:"id"`
}

StatusResponse defines structure of a houston response StatusResponse object

type Token

type Token struct {
	Success bool    `json:"success"`
	Message string  `json:"message"`
	Token   string  `json:"token"`
	Decoded Decoded `json:"decoded"`
}

Token defines structure of a houston response token object

Jump to

Keyboard shortcuts

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