api

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// HttpClient is client to use
	HttpClient *http.Client
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient(config *Config) *Client

func (*Client) DeployProject

func (c *Client) DeployProject(project *Project, params *DeployProjectInput) (*DeployProjectResponse, error)

func (*Client) GetProjectByTitle

func (c *Client) GetProjectByTitle(projectTitle string) (*Project, error)

func (*Client) GetProjects

func (c *Client) GetProjects() (*Projects, error)

func (*Client) Login

func (c *Client) Login(params *LoginData) (*LoginResponse, error)

func (*Client) PullProject

func (c *Client) PullProject(project *Project) (*PullProjectResponse, error)

type Config

type Config struct {
	// ApiKey for the api
	ApiKey string

	// Authentication cookie value
	Cca string
}

type DeployProjectInput

type DeployProjectInput struct {
	Operation string `json:"operation"`
}

type DeployProjectResponse

type DeployProjectResponse struct {
	Success bool   `json:"success"`
	Msg     string `json:"msg"`
}

type LoginData

type LoginData struct {
	Email    string `json:"user_email"`
	Password string `json:"user_pass"`
}

type LoginResponse

type LoginResponse struct {
	Success    bool   `json:"success"`
	SuccessMsg string `json:"success_msg"`
	ErrorMsg   string `json:"error_msg"`
	NewToken   string `json:"new_token"`
	Cca        string `json:"cca"`
	Username   string `json:"username"`
	UserType   string `json:"user_type"`
}

type Project

type Project struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Created     string `json:"created"`
	Code        string `json:"projekt_code"`
	Status      string `json:"status"`

	// NodeHost is hostname of node running application it can be used for further actions on project
	NodeHost string `json:"node"`
}

type Projects

type Projects []Project

type PullProjectResponse

type PullProjectResponse struct {
	Success bool `json:"success"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳