Categorygithub.com/devcyclehq/go-server-sdk
modulepackage
1.2.1
Repository: https://github.com/devcyclehq/go-server-sdk.git
Documentation: pkg.go.dev

# README

DevCycle Go Server SDK.

This SDK supports both cloud bucketing (requests outbound to https://bucketing-api.devcycle.com) as well as local bucketing (requests to a local bucketing engine self-contained in this SDK).

Installation

go get "github.com/devcyclehq/go-server-sdk"
package main
import "github.com/devcyclehq/go-server-sdk"

Getting Started

    environmentKey := os.Getenv("DVC_SERVER_KEY")
	user := devcycle.UserData{UserId: "test"}
	auth := context.WithValue(context.Background(), devcycle.ContextAPIKey, devcycle.APIKey{
		Key: environmentKey,
	})

	dvcOptions := devcycle.DVCOptions{
		EnableEdgeDB:                 false,
		DisableLocalBucketing:        false,
		EventsFlushInterval:          0,
		PollingInterval:              10 * time.Second,
		RequestTimeout:               10 * time.Second,
		DisableAutomaticEventLogging: false,
		DisableCustomEventLogging:    false,
	}

	lb, err := devcycle.InitializeLocalBucketing(environmentKey, &dvcOptions)
	if err != nil {
		log.Fatal(err)
	}
	client, _ := devcycle.NewDVCClient(environmentKey, &dvcOptions, lb)

Usage

To find usage documentation, visit our docs.

# Packages

No description provided by the author

# Functions

CacheExpires helper function to determine remaining time before repeating a request.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewDVCClient creates a new API client.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.

# Structs

APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
No description provided by the author
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
No description provided by the author
No description provided by the author
No description provided by the author
DVCClient In most cases there should be only one, shared, DVCClient.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GenericSwaggerError Provides access to the body, error and model on returned errors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author