Documentation
¶
Index ¶
- Constants
- Variables
- type APIResponse
- type Backup
- type BillingHandler
- type Card
- type CardListResponse
- type CardsHandler
- type Client
- type ConnectionPool
- type CreateDatabaseRequest
- type CreateProjectRequest
- type CreateServiceRequest
- type CreateServiceUserRequest
- type Database
- type DatabasesHandler
- type Error
- type Project
- type ProjectListResponse
- type ProjectResponse
- type ProjectsHandler
- func (h *ProjectsHandler) Create(req CreateProjectRequest) (*Project, error)
- func (h *ProjectsHandler) Delete(project string) error
- func (h *ProjectsHandler) Get(project string) (*Project, error)
- func (h *ProjectsHandler) List() ([]*Project, error)
- func (h *ProjectsHandler) Update(project string, req UpdateProjectRequest) (*Project, error)
- type Service
- type ServiceListResponse
- type ServiceResponse
- type ServiceUser
- type ServiceUserResponse
- type ServiceUsersHandler
- type ServicesHandler
- func (h *ServicesHandler) Create(project string, req CreateServiceRequest) (*Service, error)
- func (h *ServicesHandler) Delete(project, service string) error
- func (h *ServicesHandler) Get(project, service string) (*Service, error)
- func (h *ServicesHandler) List(project string) ([]*Service, error)
- func (h *ServicesHandler) Update(project, service string, req UpdateServiceRequest) (*Service, error)
- type Token
- type UpdateProjectRequest
- type UpdateServiceRequest
- type User
Constants ¶
View Source
const APIUrl = "https://api.aiven.io/v1beta/"
Variables ¶
View Source
var ( ErrNoResponseData = errors.New("No response data available") ErrInvalidHost = errors.New("Host doesn't isn't in the correct format: `hostname:port`") )
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type BillingHandler ¶
type BillingHandler struct {
Cards *CardsHandler
// contains filtered or unexported fields
}
type Card ¶
type Card struct {
Brand string `json:"brand"`
CardId string `json:"card_id"`
Country string `json:"country"`
CountryCode string `json:"country_code"`
ExpMonth int `json:"exp_month"`
ExpYear int `json:"exp_year"`
Last4 string `json:"last4"`
Name string `json:"name"`
ProjectNames []string `json:"projects"`
}
type CardListResponse ¶
type CardListResponse struct {
APIResponse
Cards []*Card `json:"cards"`
}
type CardsHandler ¶
type CardsHandler struct {
// contains filtered or unexported fields
}
func (*CardsHandler) List ¶
func (h *CardsHandler) List() ([]*Card, error)
type Client ¶
type Client struct {
ApiKey string
Client *http.Client
Projects *ProjectsHandler
Services *ServicesHandler
Databases *DatabasesHandler
ServiceUsers *ServiceUsersHandler
Billing *BillingHandler
}
Client represents the instance that does all the calls to the Aiven API.
func NewTokenClient ¶
NewTokenClient creates a new client based on a given token.
func NewUserClient ¶
NewUserClient creates a new client based on email and password.
type ConnectionPool ¶
type ConnectionPool struct {
}
type CreateDatabaseRequest ¶
type CreateProjectRequest ¶
type CreateServiceRequest ¶
type CreateServiceUserRequest ¶
type CreateServiceUserRequest struct {
Username string `json:"username"`
}
type DatabasesHandler ¶
type DatabasesHandler struct {
// contains filtered or unexported fields
}
func (*DatabasesHandler) Create ¶
func (h *DatabasesHandler) Create(project, service string, req CreateDatabaseRequest) (*Database, error)
func (*DatabasesHandler) Delete ¶
func (h *DatabasesHandler) Delete(project, service, database string) error
type Error ¶
type Error struct {
Message string `json:"message"`
MoreInfo string `json:"more_info"`
Status int `json:"status"`
}
Error represents an Aiven API Error.
type Project ¶
type Project struct {
AvailableCredits string `json:"available_credits"`
BillingAddress string `json:"billing_address"`
Card Card `json:"card_info"`
Country string `json:"country"`
CountryCode string `json:"country_code"`
DefaultCloud string `json:"default_cloud"`
EstimatedBalance string `json:"estimated_balance"`
PaymentMethod string `json:"payment_method"`
Name string `json:"project_name"`
VatId string `json:"vat_id"`
}
type ProjectListResponse ¶
type ProjectListResponse struct {
APIResponse
Projects []*Project `json:"projects"`
}
type ProjectResponse ¶
type ProjectResponse struct {
APIResponse
Project *Project `json:"project"`
}
type ProjectsHandler ¶
type ProjectsHandler struct {
// contains filtered or unexported fields
}
func (*ProjectsHandler) Create ¶
func (h *ProjectsHandler) Create(req CreateProjectRequest) (*Project, error)
func (*ProjectsHandler) Delete ¶
func (h *ProjectsHandler) Delete(project string) error
func (*ProjectsHandler) List ¶
func (h *ProjectsHandler) List() ([]*Project, error)
func (*ProjectsHandler) Update ¶
func (h *ProjectsHandler) Update(project string, req UpdateProjectRequest) (*Project, error)
type Service ¶
type Service struct {
CloudName string `json:"cloud_name"`
CreateTime string `json:"create_time"`
UpdateTime string `json:"update_time"`
GroupList []string `json:"group_list"`
NodeCount int `json:"node_count"`
Plan string `json:"plan"`
Name string `json:"service_name"`
Type string `json:"service_type"`
Uri string `json:"service_uri"`
State string `json:"state"`
Metadata interface{} `json:"metadata"`
Users []*ServiceUser `json:"users"`
}
type ServiceListResponse ¶
type ServiceListResponse struct {
APIResponse
Services []*Service `json:"services"`
}
type ServiceResponse ¶
type ServiceResponse struct {
APIResponse
Service *Service `json:"service"`
}
type ServiceUser ¶
type ServiceUserResponse ¶
type ServiceUserResponse struct {
APIResponse
User *ServiceUser `json:"user"`
}
type ServiceUsersHandler ¶
type ServiceUsersHandler struct {
// contains filtered or unexported fields
}
func (*ServiceUsersHandler) Create ¶
func (h *ServiceUsersHandler) Create(project, service string, req CreateServiceUserRequest) (*ServiceUser, error)
func (*ServiceUsersHandler) Delete ¶
func (h *ServiceUsersHandler) Delete(project, service, user string) error
type ServicesHandler ¶
type ServicesHandler struct {
// contains filtered or unexported fields
}
func (*ServicesHandler) Create ¶
func (h *ServicesHandler) Create(project string, req CreateServiceRequest) (*Service, error)
func (*ServicesHandler) Delete ¶
func (h *ServicesHandler) Delete(project, service string) error
func (*ServicesHandler) Get ¶
func (h *ServicesHandler) Get(project, service string) (*Service, error)
func (*ServicesHandler) Update ¶
func (h *ServicesHandler) Update(project, service string, req UpdateServiceRequest) (*Service, error)
type UpdateProjectRequest ¶
type UpdateServiceRequest ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.