couchbasecloud

package
v0.0.0-...-b008d83 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Name               string `json:"name"`
	MemoryQuota        int    `json:"memoryQuota"`
	Replicas           int    `json:"replicas"`
	ConflictResolution string `json:"conflictResolution"` // TODO: enum type
	Status             string `json:"string"`
}

type BucketCreatePayload

type BucketCreatePayload struct {
	Name        string `json:"name"`
	MemoryQuota int    `json:"memoryQuota"`
}

type BucketDeletePayload

type BucketDeletePayload struct {
	Name string `json:"name"`
}

type BucketRole

type BucketRole struct {
	Name  string   `json:"bucketName"`
	Roles []string `json:"bucketAccess"`
}

type BucketsList

type BucketsList struct {
	Cursor Cursor   `json:"cursor"`
	Data   []Bucket `json:"data"`
}

type Cloud

type Cloud struct {
	Id                 string `json:"id"`
	Name               string `json:"name"`
	Provider           string `json:"provider"`
	Region             string `json:"region"`
	Status             string `json:"status"`
	VirtualNetworkCIDR string `json:"virtualNetworkCidr"`
	VirtualNetworkID   string `json:"virtualNetworkId"`
}

type Clouds

type Clouds []Cloud

type CloudsList

type CloudsList struct {
	Cursor Cursor  `json:"cursor"`
	Data   []Cloud `json:"data"`
}

type Cluster

type Cluster struct {
	Id        string   `json:"id"`
	CloudId   string   `json:"cloudId"`
	Name      string   `json:"name"`
	Nodes     int      `json:"nodes"`
	ProjectId string   `json:"projectId"`
	Services  []string `json:"services"`
	TenantId  string   `json:"tenantId"`
}

type ClusterCreatePayload

type ClusterCreatePayload struct {
	Name      string `json:"name`
	CloudId   string `json:"cloudId"`
	ProjectId string `json:"projectId"`
}

type Clusters

type Clusters []Cluster

type ClustersList

type ClustersList struct {
	Cursor Cursor    `json:"cursor"`
	Data   []Cluster `json:"data"`
}

type CouchbaseCloudClient

type CouchbaseCloudClient struct {
	BaseURL    string
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiAccessKey string, apiSecretKey string) *CouchbaseCloudClient

func (*CouchbaseCloudClient) CreateBucket

func (client *CouchbaseCloudClient) CreateBucket(cluster *Cluster, payload *BucketCreatePayload) error

func (*CouchbaseCloudClient) CreateCluster

func (client *CouchbaseCloudClient) CreateCluster(payload *ClusterCreatePayload) error

func (*CouchbaseCloudClient) CreateDatabaseUser

func (client *CouchbaseCloudClient) CreateDatabaseUser(cluster *Cluster, payload *DatabaseUserCreatePayload) error

func (*CouchbaseCloudClient) CreateProject

func (client *CouchbaseCloudClient) CreateProject(payload *CreateProjectPayload) error

func (*CouchbaseCloudClient) DeleteBucket

func (client *CouchbaseCloudClient) DeleteBucket(cluster *Cluster, payload *BucketDeletePayload) error

func (*CouchbaseCloudClient) DeleteCluster

func (client *CouchbaseCloudClient) DeleteCluster(cluster *Cluster) error

func (*CouchbaseCloudClient) DeleteDatabaseUser

func (client *CouchbaseCloudClient) DeleteDatabaseUser(cluster *Cluster, payload *DatabaseUserDeletePayload) error

func (*CouchbaseCloudClient) DeleteProject

func (client *CouchbaseCloudClient) DeleteProject(projectId string) error

func (*CouchbaseCloudClient) GetCloud

func (client *CouchbaseCloudClient) GetCloud(cloudId string) error

func (*CouchbaseCloudClient) GetProject

func (client *CouchbaseCloudClient) GetProject(projectId string) (*Project, error)

func (*CouchbaseCloudClient) ListBuckets

func (client *CouchbaseCloudClient) ListBuckets(cluster *Cluster) (*BucketsList, error)

func (*CouchbaseCloudClient) ListCloudPages

func (client *CouchbaseCloudClient) ListCloudPages(options *ListCloudsOptions, fn func(Clouds, bool) bool) error

ListCloudPages allows iterating over all the clouds. For every page of cloud items it will call the callback and pass the page worth of clouds as well as a boolean that indicates whether is is the last page or not. The function iterates over all the pages either until the callback returns false, the REST endpoint returns an error or it runs out of pages.

func (*CouchbaseCloudClient) ListClouds

func (client *CouchbaseCloudClient) ListClouds(options *ListCloudsOptions) (*CloudsList, error)

func (*CouchbaseCloudClient) ListClusterPages

func (client *CouchbaseCloudClient) ListClusterPages(opts *ListClustersOptions, fn func(Clusters, bool) bool) error

ListClusterPages allows iterating over all the clusters. For every page of cluster items it will call the callback and pass the page worth of clouds as well as a boolean that indicates whether is is the last page or not. The function iterates over all the pages either until the callback returns false, the REST endpoint returns an error or it runs out of pages.

func (*CouchbaseCloudClient) ListClusters

func (client *CouchbaseCloudClient) ListClusters(options *ListClustersOptions) (*ClustersList, error)

func (*CouchbaseCloudClient) ListDatabaseUsers

func (client *CouchbaseCloudClient) ListDatabaseUsers(cluster *Cluster) (*DatabaseUsersList, error)

func (*CouchbaseCloudClient) ListProjectPages

func (client *CouchbaseCloudClient) ListProjectPages(opts *ListProjectsOptions, fn func(Projects, bool) bool) error

ListProjectPages allows iterating over all the projects. For every page of project items it will call the callback and pass the page worth of projects as well as a boolean that indicates whether is is the last page or not. The function iterates over all the pages either until the callback returns false, the REST endpoint returns an error or it runs out of pages.

func (*CouchbaseCloudClient) ListProjects

func (client *CouchbaseCloudClient) ListProjects(options *ListProjectsOptions) (*ProjectsList, error)

func (*CouchbaseCloudClient) ListUserPages

func (client *CouchbaseCloudClient) ListUserPages(options *ListUsersOptions, fn func(Users, bool) bool) error

ListUserPages allows iterating over all the users. For every page of user items it will call the callback and pass the page worth of users as well as a boolean that indicates whether is is the last page or not. The function iterates over all the pages either until the callback returns false, the REST endpoint returns an error or it runs out of pages.

func (*CouchbaseCloudClient) ListUsers

func (client *CouchbaseCloudClient) ListUsers(options *ListUsersOptions) (*UsersList, error)

func (*CouchbaseCloudClient) UpdateBucket

func (client *CouchbaseCloudClient) UpdateBucket(cluster *Cluster, payload []*BucketCreatePayload) error

type CreateProjectPayload

type CreateProjectPayload struct {
	Name string `json:"name"`
}

type Cursor

type Cursor struct {
	Hrefs struct {
		First string `json:"first"`
		Last  string `json:"last"`
	} `json:"hrefs"`
	Pages struct {
		Last       int `json:"last"`
		Page       int `json:"page"`
		PerPage    int `json:"perPage"`
		TotalItems int `json:"totalItems"`
	} `json:"pages"`
}

type DatabaseUser

type DatabaseUser struct {
	UserId   string       `json:userId,omitempty"`
	Username string       `json:"username,omitempty"`
	Password string       `json:"password,omitempty"`
	Access   []BucketRole `json:"buckets,omitempty"`
}

type DatabaseUserCreatePayload

type DatabaseUserCreatePayload struct {
	UserId           string       `json:userId,omitempty"`
	Username         string       `json:"username,omitempty"`
	Password         string       `json:"password,omitempty"`
	Buckets          []BucketRole `json:"buckets,omitempty"`
	AllBucketsAccess string       `json:"allBucketsAccess,omitempty"`
}

type DatabaseUserDeletePayload

type DatabaseUserDeletePayload struct {
	Username string `json:"username,omitempty"`
}

type DatabaseUsers

type DatabaseUsers []DatabaseUser

type DatabaseUsersList

type DatabaseUsersList struct {
	Cursor Cursor         `json:"cursor"`
	Data   []DatabaseUser `json:"data"`
}

type ListCloudsOptions

type ListCloudsOptions struct {
	Page    int     `json:"page"`
	PerPage int     `json:"perPage"`
	SortBy  *string `json:"sortBy"`
}

type ListClustersOptions

type ListClustersOptions struct {
	Page      int     `json:"page"`
	PerPage   int     `json:"perPage"`
	SortBy    *string `json:"sortBy"`
	CloudId   *string `json:"cloudId"`
	ProjectId *string `json:"projectId"`
}

type ListProjectsOptions

type ListProjectsOptions struct {
	Page    int     `json:"page"`
	PerPage int     `json:"perPage"`
	SortBy  *string `json:"sortBy"`
}

type ListUsersOptions

type ListUsersOptions struct {
	Page    int     `json:"page"`
	PerPage int     `json:"perPage"`
	SortBy  *string `json:"sortBy"`
}

type Project

type Project struct {
	Id        string `json:"id"`
	Name      string `json:"name"`
	TenantId  string `json:"tenantId"`
	CreatedAt string `json:"createdAt"`
}

type Projects

type Projects []Project

type ProjectsList

type ProjectsList struct {
	Cursor Cursor    `json:"cursor"`
	Data   []Project `json:"data"`
}

type User

type User struct {
	Id    string `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
}

type Users

type Users []Users

type UsersList

type UsersList struct {
	Cursor Cursor  `json:"cursor"`
	Data   []Users `json:"data"`
}

Jump to

Keyboard shortcuts

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