Documentation
¶
Index ¶
- type Client
- func (c *Client) CreateDeployment(title string) (*StatusResponse, error)
- func (c *Client) CreateToken(email string, password string) (*Token, error)
- func (c *Client) FetchDeployment(deploymentUuid string) (*Deployment, error)
- func (c *Client) FetchDeployments() ([]Deployment, error)
- func (c *Client) QueryHouston(query string) (*HoustonResponse, error)
- type CreateTokenResponse
- type Decoded
- type Deployment
- type FetchDeploymentsResponse
- type GraphQLQuery
- type HoustonResponse
- type StatusResponse
- type Token
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 ¶
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