Documentation ¶
Index ¶
- Constants
- func IsNotFound(err error) bool
- func NeedsUpdate(kube *v1alpha2.CloudMemorystoreInstance, gcp *redisv1pb.Instance) bool
- func NewCreateInstanceRequest(id InstanceID, i *v1alpha2.CloudMemorystoreInstance) *redisv1pb.CreateInstanceRequest
- func NewDeleteInstanceRequest(id InstanceID) *redisv1pb.DeleteInstanceRequest
- func NewGetInstanceRequest(id InstanceID) *redisv1pb.GetInstanceRequest
- func NewInstanceTier(t string) redisv1pb.Instance_Tier
- func NewUpdateInstanceRequest(id InstanceID, i *v1alpha2.CloudMemorystoreInstance) *redisv1pb.UpdateInstanceRequest
- type Client
- type InstanceID
Constants ¶
const NamePrefix = "cms"
NamePrefix is the prefix for all created CloudMemorystore instances.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
IsNotFound returns true if the supplied error indicates a CloudMemorystore instance was not found.
func NeedsUpdate ¶
func NeedsUpdate(kube *v1alpha2.CloudMemorystoreInstance, gcp *redisv1pb.Instance) bool
NeedsUpdate 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 NewCreateInstanceRequest ¶
func NewCreateInstanceRequest(id InstanceID, i *v1alpha2.CloudMemorystoreInstance) *redisv1pb.CreateInstanceRequest
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 NewInstanceTier ¶
func NewInstanceTier(t string) redisv1pb.Instance_Tier
NewInstanceTier converts the supplied string representation of a tier into an Instance_Tier suitable for use with requests to the GCP API.
func NewUpdateInstanceRequest ¶
func NewUpdateInstanceRequest(id InstanceID, i *v1alpha2.CloudMemorystoreInstance) *redisv1pb.UpdateInstanceRequest
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.
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 *v1alpha2.CloudMemorystoreInstance) InstanceID
NewInstanceID returns an identifier used to represent CloudMemorystore instances in the GCP API. Instances may have names of up to 40 characters. We use a four character prefix and a 36 character UUID. 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.