cloudmemorystore

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StateCreating = redisv1pb.Instance_CREATING.String()
	StateReady    = redisv1pb.Instance_READY.String()
	StateDeleting = redisv1pb.Instance_DELETING.String()
)

Cloud Memorystore instance states. Only the subset that is used is listed.

Functions

func GenerateObservation

GenerateObservation is used to produce an observation object from GCP's Redis Instance object.

func GenerateRedisInstance

GenerateRedisInstance is used to convert Crossplane CloudMemorystoreInstanceParameters to GCP's Redis Instance object.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if the supplied error indicates a CloudMemorystore instance was not found.

func IsUpToDate

IsUpToDate returns true if the supplied Kubernetes resource differs from the supplied GCP resource. It considers only fields that can be modified in place without deleting and recreating the instance.

func LateInitializeSpec

func LateInitializeSpec(spec *v1beta1.CloudMemorystoreInstanceParameters, r redisv1pb.Instance)

LateInitializeSpec fills empty spec fields with the data retrieved from GCP.

func NewCreateInstanceRequest

NewCreateInstanceRequest creates a request to create an instance suitable for use with the GCP API.

func NewDeleteInstanceRequest

func NewDeleteInstanceRequest(id InstanceID) *redisv1pb.DeleteInstanceRequest

NewDeleteInstanceRequest creates a request to delete an instance suitable for use with the GCP API.

func NewGetInstanceRequest

func NewGetInstanceRequest(id InstanceID) *redisv1pb.GetInstanceRequest

NewGetInstanceRequest creates a request to get an instance from the GCP API.

func NewUpdateInstanceRequest

NewUpdateInstanceRequest creates a request to update an instance suitable for use with the GCP API.

Types

type Client

type Client interface {
	CreateInstance(ctx context.Context, req *redisv1pb.CreateInstanceRequest, opts ...gax.CallOption) (*redisv1.CreateInstanceOperation, error)
	UpdateInstance(ctx context.Context, req *redisv1pb.UpdateInstanceRequest, opts ...gax.CallOption) (*redisv1.UpdateInstanceOperation, error)
	DeleteInstance(ctx context.Context, req *redisv1pb.DeleteInstanceRequest, opts ...gax.CallOption) (*redisv1.DeleteInstanceOperation, error)
	GetInstance(ctx context.Context, req *redisv1pb.GetInstanceRequest, opts ...gax.CallOption) (*redisv1pb.Instance, error)
}

A Client handles CRUD operations for Cloud Memorystore instances. This interface is compatible with the upstream CloudRedisClient.

func NewClient

func NewClient(ctx context.Context, credentials []byte) (Client, error)

NewClient returns a new CloudMemorystore Client. Credentials must be passed as JSON encoded data.

type InstanceID

type InstanceID struct {
	// Project in which this instance exists.
	Project string

	// Region in which this instance exists. The API calls this a 'location',
	// which is an overloaded term considering instances also have a 'location
	// id' (and 'alternative location id'), which represent zones.
	Region string

	// Instance name, or ID. The GCP API appears to call the unqualified name
	// (e.g. 'coolinstance') an ID, and the qualified name (e.g.
	// 'projects/coolproject/locations/us-west2/instances/coolinstance') a name.
	Instance string
}

An InstanceID represents a CloudMemorystore instance in the GCP API.

func NewInstanceID

func NewInstanceID(project string, i *v1beta1.CloudMemorystoreInstance) InstanceID

NewInstanceID returns an identifier used to represent CloudMemorystore instances in the GCP API. Instances may have names of up to 40 characters. https://godoc.org/google.golang.org/genproto/googleapis/cloud/redis/v1#CreateInstanceRequest

func (InstanceID) Name

func (id InstanceID) Name() string

Name returns the instance's name, suitable for get and delete API calls.

func (InstanceID) Parent

func (id InstanceID) Parent() string

Parent returns the instance's parent, suitable for the create API call.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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