RedisLabs / rediscloud-go-api

Go SDK for Redis Enterprise Cloud Pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rediscloud-go-api

This repository is a Go SDK for the Redis Cloud REST API.

Getting Started

Installing

You can use this module by using go get to add it to either your GOPATH workspace or the project's dependencies.

go get github.com/RedisLabs/rediscloud-go-api

Example

This is an example of using the SDK

package main

import (
	"context"
	"fmt"

	rediscloud_api "github.com/RedisLabs/rediscloud-go-api"
	"github.com/RedisLabs/rediscloud-go-api/service/subscriptions"
)

func main() {
	// The client will use the credentials from `REDISCLOUD_ACCESS_KEY` and `REDISCLOUD_SECRET_KEY` by default
	client, err := rediscloud_api.NewClient()
	if err != nil {
		panic(err)
	}

	id, err := client.Subscription.Create(context.TODO(), subscriptions.CreateSubscription{
		// ...
	})
	if err != nil {
		panic(err)
	}

	fmt.Printf("Created subscription: %d", id)
}

About

Go SDK for Redis Enterprise Cloud Pro

License:Apache License 2.0


Languages

Language:Go 99.7%Language:Makefile 0.3%