gogrowthbook

package module
v0.0.0-...-294529b Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 22 Imported by: 0

README

Background

GrowthBook provides the OpenAPI 3.1.0 specification of their API. However, it is not trivial to immediately use it to auto-generate a Go client from this spec. There are two reasons for this. a) the spec file provided is, at the moment of creating this repository, malformed (see partially corrected file in growthbook-openapi.yaml) and b) from the various client generators available publicly, not all of them support 3.1.0 version of the OpenAPI spec, or do it only partially.

Some of the errors in their spec include misspelling keyword object as obect, missing description field in their HTTP expected responses and others.

Therefore I created this repository where I used OpenAPI tools to auto-generate most of the code. I however needed to make some amendments. For example, OpenAPI tools do not support AnyOf clause for Go clients, also the tool dumps all files in the same folder and Go package, so I split out the models in a separate folder and Go package for clarity.

Motivation

At the moment of creating this repository there is no Golang client/SDK to interact with the complete API of GrowthBook. There is an SDK provided by GrowthBook to access just one endpoint (to read features). However, the rest of the API is not accessible via the aforementioned SDK.

One use case to have a Go client to access GrowthBook API is to be able to implement a GrowthBook Terraform provider - which at the moment of writing creating this repository, is inexistent.

How to install

This SDK requires Go >= 1.21 You can install it by issuing the classic

go get github.com/JoseFMP/gogrowthbook

As well as go install github.com/JoseFMP/gogrowthbook if required.

How to use

As the code is mostly autogenerated with OpenAPI tools, it is mostly very consistent as one model and one interface per endpoint of the API.

Here a toy example:

package main

import "github.com/JoseFMP/gogrowthbook"

func main() {
  cfg := gogrowthbook.NewConfiguration()
  
  // initialization of the client. Nothing really going on here.
  client := gogrowthbook.NewAPIClient(cfg)

  // secretKey can be generated in GrowthBook UI. Personal Access Token works too.
  // Depending on the operations you plan to do (read only or write) you might require 'admin' permission on the key, or just 'readonly'
  // Note: Obviously this key is sensitive.
  secretKey := "secret_key_blabla"
  clientContext := context.Background()

  // sets the secret key in to the context, this way the client can use it
  // Note: we could use different keys for different requests using the very same client
  clientContext = context.WithValue(clientContext, gogrowthbook.ContextAccessToken, secretKey)

  exampleNewFeature := models.PostFeatureRequest{
    Id:          "example-put-here-unique-feature-id",
    ValueType:   "string",
    Description: "This is an example feature, ignore it!",
  }
  newFeatureReq := client.FeaturesAPI.PostFeature(clientContext).PostFeatureRequest(exampleNewFeature)

  responsePayload, httpResponse, errDoingReq := newFeatureReq.Execute()

  fmt.Printf("Creating new feature result: %d, %s, %v\n%v", httpResponse.StatusCode, httpResponse.Status, errDoingReq, responsePayload)
}

You can see a fully working integration test in client_test.go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`)
	XmlCheck  = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`)
)
View Source
var (
	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextServerIndex uses a server configuration from the index.
	ContextServerIndex = contextKey("serverIndex")

	// ContextOperationServerIndices uses a server configuration from the index mapping.
	ContextOperationServerIndices = contextKey("serverOperationIndices")

	// ContextServerVariables overrides a server configuration variables.
	ContextServerVariables = contextKey("serverVariables")

	// ContextOperationServerVariables overrides a server configuration variables using operation specific values.
	ContextOperationServerVariables = contextKey("serverOperationVariables")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	DataSourcesAPI *DataSourcesAPIService

	DimensionsAPI *DimensionsAPIService

	ExperimentsAPI *ExperimentsAPIService

	FeaturesAPI *FeaturesAPIService

	MetricsAPI *MetricsAPIService

	OrganizationsAPI *OrganizationsAPIService

	ProjectsAPI *ProjectsAPIService

	SavedGroupsAPI *SavedGroupsAPIService

	SdkConnectionsAPI *SdkConnectionsAPIService

	SegmentsAPI *SegmentsAPIService

	VisualChangesetsAPI *VisualChangesetsAPIService
	// contains filtered or unexported fields
}

APIClient manages communication with the GrowthBook REST API API v1.0.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() *Configuration

Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the OpenAPI operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

APIResponse stores the API response returned by the server.

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

NewAPIResponse returns a new APIResponse object.

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

NewAPIResponseWithError returns a new APIResponse object with the provided error message.

type ApiDeleteMetricRequest

type ApiDeleteMetricRequest struct {
	ApiService *MetricsAPIService
	// contains filtered or unexported fields
}

func (ApiDeleteMetricRequest) Execute

type ApiDeleteSavedGroupRequest

type ApiDeleteSavedGroupRequest struct {
	ApiService *SavedGroupsAPIService
	// contains filtered or unexported fields
}

func (ApiDeleteSavedGroupRequest) Execute

type ApiGetDataSourceRequest

type ApiGetDataSourceRequest struct {
	ApiService *DataSourcesAPIService
	// contains filtered or unexported fields
}

func (ApiGetDataSourceRequest) Execute

type ApiGetDimensionRequest

type ApiGetDimensionRequest struct {
	ApiService *DimensionsAPIService
	// contains filtered or unexported fields
}

func (ApiGetDimensionRequest) Execute

type ApiGetExperimentRequest

type ApiGetExperimentRequest struct {
	ApiService *ExperimentsAPIService
	// contains filtered or unexported fields
}

func (ApiGetExperimentRequest) Execute

type ApiGetExperimentResultsRequest

type ApiGetExperimentResultsRequest struct {
	ApiService *ExperimentsAPIService
	// contains filtered or unexported fields
}

func (ApiGetExperimentResultsRequest) Dimension

func (ApiGetExperimentResultsRequest) Execute

func (ApiGetExperimentResultsRequest) Phase

type ApiGetFeatureRequest

type ApiGetFeatureRequest struct {
	ApiService *FeaturesAPIService
	// contains filtered or unexported fields
}

func (ApiGetFeatureRequest) Execute

type ApiGetMetricRequest

type ApiGetMetricRequest struct {
	ApiService *MetricsAPIService
	// contains filtered or unexported fields
}

func (ApiGetMetricRequest) Execute

type ApiGetProjectRequest

type ApiGetProjectRequest struct {
	ApiService *ProjectsAPIService
	// contains filtered or unexported fields
}

func (ApiGetProjectRequest) Execute

type ApiGetSavedGroupRequest

type ApiGetSavedGroupRequest struct {
	ApiService *SavedGroupsAPIService
	// contains filtered or unexported fields
}

func (ApiGetSavedGroupRequest) Execute

type ApiGetSdkConnectionRequest

type ApiGetSdkConnectionRequest struct {
	ApiService *SdkConnectionsAPIService
	// contains filtered or unexported fields
}

func (ApiGetSdkConnectionRequest) Execute

type ApiGetSegmentRequest

type ApiGetSegmentRequest struct {
	ApiService *SegmentsAPIService
	// contains filtered or unexported fields
}

func (ApiGetSegmentRequest) Execute

type ApiGetVisualChangesetRequest

type ApiGetVisualChangesetRequest struct {
	ApiService *VisualChangesetsAPIService
	// contains filtered or unexported fields
}

func (ApiGetVisualChangesetRequest) Execute

func (ApiGetVisualChangesetRequest) IncludeExperiment

func (r ApiGetVisualChangesetRequest) IncludeExperiment(includeExperiment int32) ApiGetVisualChangesetRequest

Include the associated experiment in payload

type ApiListDataSourcesRequest

type ApiListDataSourcesRequest struct {
	ApiService *DataSourcesAPIService
	// contains filtered or unexported fields
}

func (ApiListDataSourcesRequest) Execute

func (ApiListDataSourcesRequest) Limit

func (r ApiListDataSourcesRequest) Limit(limit interface{}) ApiListDataSourcesRequest

The number of items to return

func (ApiListDataSourcesRequest) Offset

func (r ApiListDataSourcesRequest) Offset(offset interface{}) ApiListDataSourcesRequest

How many items to skip (use in conjunction with limit for pagination)

func (ApiListDataSourcesRequest) ProjectId

func (r ApiListDataSourcesRequest) ProjectId(projectId interface{}) ApiListDataSourcesRequest

Filter by project id

type ApiListDimensionsRequest

type ApiListDimensionsRequest struct {
	ApiService *DimensionsAPIService
	// contains filtered or unexported fields
}

func (ApiListDimensionsRequest) DatasourceId

func (r ApiListDimensionsRequest) DatasourceId(datasourceId interface{}) ApiListDimensionsRequest

Filter by Data Source

func (ApiListDimensionsRequest) Execute

func (ApiListDimensionsRequest) Limit

func (r ApiListDimensionsRequest) Limit(limit interface{}) ApiListDimensionsRequest

The number of items to return

func (ApiListDimensionsRequest) Offset

func (r ApiListDimensionsRequest) Offset(offset interface{}) ApiListDimensionsRequest

How many items to skip (use in conjunction with limit for pagination)

type ApiListExperimentsRequest

type ApiListExperimentsRequest struct {
	ApiService *ExperimentsAPIService
	// contains filtered or unexported fields
}

func (ApiListExperimentsRequest) DatasourceId

func (r ApiListExperimentsRequest) DatasourceId(datasourceId interface{}) ApiListExperimentsRequest

Filter by Data Source

func (ApiListExperimentsRequest) Execute

func (ApiListExperimentsRequest) ExperimentId

func (r ApiListExperimentsRequest) ExperimentId(experimentId string) ApiListExperimentsRequest

Filter the returned list by the experiment tracking key (id)

func (ApiListExperimentsRequest) Limit

func (r ApiListExperimentsRequest) Limit(limit interface{}) ApiListExperimentsRequest

The number of items to return

func (ApiListExperimentsRequest) Offset

func (r ApiListExperimentsRequest) Offset(offset interface{}) ApiListExperimentsRequest

How many items to skip (use in conjunction with limit for pagination)

func (ApiListExperimentsRequest) ProjectId

func (r ApiListExperimentsRequest) ProjectId(projectId interface{}) ApiListExperimentsRequest

Filter by project id

type ApiListFeaturesRequest

type ApiListFeaturesRequest struct {
	ApiService *FeaturesAPIService
	// contains filtered or unexported fields
}

func (ApiListFeaturesRequest) Execute

func (ApiListFeaturesRequest) Limit

The number of items to return

func (ApiListFeaturesRequest) Offset

How many items to skip (use in conjunction with limit for pagination)

func (ApiListFeaturesRequest) ProjectId

func (r ApiListFeaturesRequest) ProjectId(projectId *string) ApiListFeaturesRequest

Filter by project id

type ApiListMetricsRequest

type ApiListMetricsRequest struct {
	ApiService *MetricsAPIService
	// contains filtered or unexported fields
}

func (ApiListMetricsRequest) DatasourceId

func (r ApiListMetricsRequest) DatasourceId(datasourceId interface{}) ApiListMetricsRequest

Filter by Data Source

func (ApiListMetricsRequest) Execute

func (ApiListMetricsRequest) Limit

func (r ApiListMetricsRequest) Limit(limit interface{}) ApiListMetricsRequest

The number of items to return

func (ApiListMetricsRequest) Offset

func (r ApiListMetricsRequest) Offset(offset interface{}) ApiListMetricsRequest

How many items to skip (use in conjunction with limit for pagination)

func (ApiListMetricsRequest) ProjectId

func (r ApiListMetricsRequest) ProjectId(projectId interface{}) ApiListMetricsRequest

Filter by project id

type ApiListOrganizationsRequest

type ApiListOrganizationsRequest struct {
	ApiService *OrganizationsAPIService
	// contains filtered or unexported fields
}

func (ApiListOrganizationsRequest) Execute

func (ApiListOrganizationsRequest) Limit

The number of items to return

func (ApiListOrganizationsRequest) Offset

How many items to skip (use in conjunction with limit for pagination)

func (ApiListOrganizationsRequest) Search

Search string to search organization names, owner emails, and external ids by

type ApiListProjectsRequest

type ApiListProjectsRequest struct {
	ApiService *ProjectsAPIService
	// contains filtered or unexported fields
}

func (ApiListProjectsRequest) Execute

func (ApiListProjectsRequest) Limit

The number of items to return

func (ApiListProjectsRequest) Offset

How many items to skip (use in conjunction with limit for pagination)

type ApiListSavedGroupsRequest

type ApiListSavedGroupsRequest struct {
	ApiService *SavedGroupsAPIService
	// contains filtered or unexported fields
}

func (ApiListSavedGroupsRequest) Execute

func (ApiListSavedGroupsRequest) Limit

func (r ApiListSavedGroupsRequest) Limit(limit interface{}) ApiListSavedGroupsRequest

The number of items to return

func (ApiListSavedGroupsRequest) Offset

func (r ApiListSavedGroupsRequest) Offset(offset interface{}) ApiListSavedGroupsRequest

How many items to skip (use in conjunction with limit for pagination)

type ApiListSdkConnectionsRequest

type ApiListSdkConnectionsRequest struct {
	ApiService *SdkConnectionsAPIService
	// contains filtered or unexported fields
}

func (ApiListSdkConnectionsRequest) Execute

func (ApiListSdkConnectionsRequest) Limit

The number of items to return

func (ApiListSdkConnectionsRequest) MultiOrg

func (ApiListSdkConnectionsRequest) Offset

func (r ApiListSdkConnectionsRequest) Offset(offset interface{}) ApiListSdkConnectionsRequest

How many items to skip (use in conjunction with limit for pagination)

func (ApiListSdkConnectionsRequest) ProjectId

func (r ApiListSdkConnectionsRequest) ProjectId(projectId interface{}) ApiListSdkConnectionsRequest

Filter by project id

func (ApiListSdkConnectionsRequest) WithProxy

type ApiListSegmentsRequest

type ApiListSegmentsRequest struct {
	ApiService *SegmentsAPIService
	// contains filtered or unexported fields
}

func (ApiListSegmentsRequest) DatasourceId

func (r ApiListSegmentsRequest) DatasourceId(datasourceId interface{}) ApiListSegmentsRequest

Filter by Data Source

func (ApiListSegmentsRequest) Execute

func (ApiListSegmentsRequest) Limit

func (r ApiListSegmentsRequest) Limit(limit interface{}) ApiListSegmentsRequest

The number of items to return

func (ApiListSegmentsRequest) Offset

func (r ApiListSegmentsRequest) Offset(offset interface{}) ApiListSegmentsRequest

How many items to skip (use in conjunction with limit for pagination)

type ApiListVisualChangesetsRequest

type ApiListVisualChangesetsRequest struct {
	ApiService *VisualChangesetsAPIService
	// contains filtered or unexported fields
}

func (ApiListVisualChangesetsRequest) Execute

type ApiPostExperimentRequest

type ApiPostExperimentRequest struct {
	ApiService *ExperimentsAPIService
	// contains filtered or unexported fields
}

func (ApiPostExperimentRequest) Execute

func (ApiPostExperimentRequest) PostExperimentRequest

func (r ApiPostExperimentRequest) PostExperimentRequest(postExperimentRequest models.PostExperimentRequest) ApiPostExperimentRequest

type ApiPostFeatureRequest

type ApiPostFeatureRequest struct {
	ApiService *FeaturesAPIService
	// contains filtered or unexported fields
}

func (ApiPostFeatureRequest) Execute

func (ApiPostFeatureRequest) PostFeatureRequest

func (r ApiPostFeatureRequest) PostFeatureRequest(postFeatureRequest models.PostFeatureRequest) ApiPostFeatureRequest

type ApiPostMetricRequest

type ApiPostMetricRequest struct {
	ApiService *MetricsAPIService
	// contains filtered or unexported fields
}

func (ApiPostMetricRequest) Execute

func (ApiPostMetricRequest) PostMetricRequest

func (r ApiPostMetricRequest) PostMetricRequest(postMetricRequest models.PostMetricRequest) ApiPostMetricRequest

type ApiPostOrganizationRequest

type ApiPostOrganizationRequest struct {
	ApiService *OrganizationsAPIService
	// contains filtered or unexported fields
}

func (ApiPostOrganizationRequest) Execute

func (ApiPostOrganizationRequest) PostOrganizationRequest

func (r ApiPostOrganizationRequest) PostOrganizationRequest(postOrganizationRequest models.PostOrganizationRequest) ApiPostOrganizationRequest

type ApiPostSavedGroupRequest

type ApiPostSavedGroupRequest struct {
	ApiService *SavedGroupsAPIService
	// contains filtered or unexported fields
}

func (ApiPostSavedGroupRequest) Execute

func (ApiPostSavedGroupRequest) PostSavedGroupRequest

func (r ApiPostSavedGroupRequest) PostSavedGroupRequest(postSavedGroupRequest models.PostSavedGroupRequest) ApiPostSavedGroupRequest

type ApiPostVisualChangeRequest

type ApiPostVisualChangeRequest struct {
	ApiService *VisualChangesetsAPIService
	// contains filtered or unexported fields
}

func (ApiPostVisualChangeRequest) Execute

type ApiPutMetricRequest

type ApiPutMetricRequest struct {
	ApiService *MetricsAPIService
	// contains filtered or unexported fields
}

func (ApiPutMetricRequest) Execute

func (ApiPutMetricRequest) PutMetricRequest

func (r ApiPutMetricRequest) PutMetricRequest(putMetricRequest models.PutMetricRequest) ApiPutMetricRequest

type ApiPutOrganizationRequest

type ApiPutOrganizationRequest struct {
	ApiService *OrganizationsAPIService
	// contains filtered or unexported fields
}

func (ApiPutOrganizationRequest) Execute

func (ApiPutOrganizationRequest) PutOrganizationRequest

func (r ApiPutOrganizationRequest) PutOrganizationRequest(putOrganizationRequest models.PutOrganizationRequest) ApiPutOrganizationRequest

type ApiPutVisualChangeRequest

type ApiPutVisualChangeRequest struct {
	ApiService *VisualChangesetsAPIService
	// contains filtered or unexported fields
}

func (ApiPutVisualChangeRequest) Execute

type ApiPutVisualChangesetRequest

type ApiPutVisualChangesetRequest struct {
	ApiService *VisualChangesetsAPIService
	// contains filtered or unexported fields
}

func (ApiPutVisualChangesetRequest) Execute

type ApiToggleFeatureRequest

type ApiToggleFeatureRequest struct {
	ApiService *FeaturesAPIService
	// contains filtered or unexported fields
}

func (ApiToggleFeatureRequest) Execute

func (ApiToggleFeatureRequest) ToggleFeatureRequest

func (r ApiToggleFeatureRequest) ToggleFeatureRequest(toggleFeatureRequest models.ToggleFeatureRequest) ApiToggleFeatureRequest

type ApiUpdateExperimentRequest

type ApiUpdateExperimentRequest struct {
	ApiService *ExperimentsAPIService
	// contains filtered or unexported fields
}

func (ApiUpdateExperimentRequest) Execute

func (ApiUpdateExperimentRequest) UpdateExperimentRequest

func (r ApiUpdateExperimentRequest) UpdateExperimentRequest(updateExperimentRequest models.UpdateExperimentRequest) ApiUpdateExperimentRequest

type ApiUpdateFeatureRequest

type ApiUpdateFeatureRequest struct {
	ApiService *FeaturesAPIService
	// contains filtered or unexported fields
}

func (ApiUpdateFeatureRequest) Execute

func (ApiUpdateFeatureRequest) UpdateFeatureRequest

func (r ApiUpdateFeatureRequest) UpdateFeatureRequest(updateFeatureRequest models.UpdateFeatureRequest) ApiUpdateFeatureRequest

type ApiUpdateSavedGroupRequest

type ApiUpdateSavedGroupRequest struct {
	ApiService *SavedGroupsAPIService
	// contains filtered or unexported fields
}

func (ApiUpdateSavedGroupRequest) Execute

func (ApiUpdateSavedGroupRequest) UpdateSavedGroupRequest

func (r ApiUpdateSavedGroupRequest) UpdateSavedGroupRequest(updateSavedGroupRequest models.UpdateSavedGroupRequest) ApiUpdateSavedGroupRequest

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration

type Configuration struct {
	Host             string            `json:"host,omitempty"`
	Scheme           string            `json:"scheme,omitempty"`
	DefaultHeader    map[string]string `json:"defaultHeader,omitempty"`
	UserAgent        string            `json:"userAgent,omitempty"`
	Debug            bool              `json:"debug,omitempty"`
	Servers          ServerConfigurations
	OperationServers map[string]ServerConfigurations
	HTTPClient       *http.Client
}

Configuration stores the configuration of the API client

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration returns a new Configuration object

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

AddDefaultHeader adds a new HTTP header to the default header in the request

func (*Configuration) ServerURL

func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error)

ServerURL returns URL based on server settings

func (*Configuration) ServerURLWithContext

func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error)

ServerURLWithContext returns a new server URL given an endpoint

type DataSourcesAPIService

type DataSourcesAPIService service

DataSourcesAPIService DataSourcesAPI service

func (*DataSourcesAPIService) GetDataSource

func (a *DataSourcesAPIService) GetDataSource(ctx context.Context, id interface{}) ApiGetDataSourceRequest

GetDataSource Get a single data source

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiGetDataSourceRequest

func (*DataSourcesAPIService) GetDataSourceExecute

Execute executes the request

@returnmodels.GetDataSource200Response

func (*DataSourcesAPIService) ListDataSources

ListDataSources Get all data sources

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListDataSourcesRequest

func (*DataSourcesAPIService) ListDataSourcesExecute

Execute executes the request

@return ListDataSources200Response

type DimensionsAPIService

type DimensionsAPIService service

DimensionsAPIService DimensionsAPI service

func (*DimensionsAPIService) GetDimension

func (a *DimensionsAPIService) GetDimension(ctx context.Context, id interface{}) ApiGetDimensionRequest

GetDimension Get a single dimension

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiGetDimensionRequest

func (*DimensionsAPIService) GetDimensionExecute

Execute executes the request

@return GetDimension200Response

func (*DimensionsAPIService) ListDimensions

ListDimensions Get all dimensions

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListDimensionsRequest

func (*DimensionsAPIService) ListDimensionsExecute

Execute executes the request

@return ListDimensions200Response

type ExperimentsAPIService

type ExperimentsAPIService service

ExperimentsAPIService ExperimentsAPI service

func (*ExperimentsAPIService) GetExperiment

func (a *ExperimentsAPIService) GetExperiment(ctx context.Context, id interface{}) ApiGetExperimentRequest

GetExperiment Get a single experiment

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiGetExperimentRequest

func (*ExperimentsAPIService) GetExperimentExecute

Execute executes the request

@return models.models.PostExperiment200Response

func (*ExperimentsAPIService) GetExperimentResults

func (a *ExperimentsAPIService) GetExperimentResults(ctx context.Context, id interface{}) ApiGetExperimentResultsRequest

GetExperimentResults Get results for an experiment

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiGetExperimentResultsRequest

func (*ExperimentsAPIService) GetExperimentResultsExecute

Execute executes the request

@return GetExperimentResults200Response

func (*ExperimentsAPIService) ListExperiments

ListExperiments Get all experiments

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListExperimentsRequest

func (*ExperimentsAPIService) ListExperimentsExecute

Execute executes the request

@return ListExperiments200Response

func (*ExperimentsAPIService) PostExperiment

PostExperiment Create a single experiment

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiPostExperimentRequest

func (*ExperimentsAPIService) PostExperimentExecute

Execute executes the request

@return models.PostExperiment200Response

func (*ExperimentsAPIService) UpdateExperiment

func (a *ExperimentsAPIService) UpdateExperiment(ctx context.Context, id interface{}) ApiUpdateExperimentRequest

UpdateExperiment Update a single experiment

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiUpdateExperimentRequest

func (*ExperimentsAPIService) UpdateExperimentExecute

Execute executes the request

@return models.PostExperiment200Response

type FeaturesAPIService

type FeaturesAPIService service

FeaturesAPIService FeaturesAPI service

func (*FeaturesAPIService) GetFeature

func (a *FeaturesAPIService) GetFeature(ctx context.Context, id interface{}) ApiGetFeatureRequest

GetFeature Get a single feature

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiGetFeatureRequest

func (*FeaturesAPIService) GetFeatureExecute

Execute executes the request

@return PostFeature200Response

func (*FeaturesAPIService) ListFeatures

ListFeatures Get all features

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListFeaturesRequest

func (*FeaturesAPIService) ListFeaturesExecute

Execute executes the request

@return ListFeatures200Response

func (*FeaturesAPIService) PostFeature

PostFeature Create a single feature

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiPostFeatureRequest

func (*FeaturesAPIService) PostFeatureExecute

Execute executes the request

@return PostFeature200Response

func (*FeaturesAPIService) ToggleFeature

func (a *FeaturesAPIService) ToggleFeature(ctx context.Context, id interface{}) ApiToggleFeatureRequest

ToggleFeature Toggle a feature in one or more environments

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiToggleFeatureRequest

func (*FeaturesAPIService) ToggleFeatureExecute

Execute executes the request

@return PostFeature200Response

func (*FeaturesAPIService) UpdateFeature

func (a *FeaturesAPIService) UpdateFeature(ctx context.Context, id interface{}) ApiUpdateFeatureRequest

UpdateFeature Partially update a feature

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiUpdateFeatureRequest

func (*FeaturesAPIService) UpdateFeatureExecute

Execute executes the request

@return PostFeature200Response

type GenericOpenAPIError

type GenericOpenAPIError struct {
	// contains filtered or unexported fields
}

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type MetricsAPIService

type MetricsAPIService service

MetricsAPIService MetricsAPI service

func (*MetricsAPIService) DeleteMetric

func (a *MetricsAPIService) DeleteMetric(ctx context.Context, id interface{}) ApiDeleteMetricRequest

DeleteMetric Deletes a metric

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiDeleteMetricRequest

func (*MetricsAPIService) DeleteMetricExecute

Execute executes the request

@return DeleteMetric200Response

func (*MetricsAPIService) GetMetric

func (a *MetricsAPIService) GetMetric(ctx context.Context, id interface{}) ApiGetMetricRequest

GetMetric Get a single metric

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiGetMetricRequest

func (*MetricsAPIService) GetMetricExecute

Execute executes the request

@return PostMetric200Response

func (*MetricsAPIService) ListMetrics

ListMetrics Get all metrics

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListMetricsRequest

func (*MetricsAPIService) ListMetricsExecute

Execute executes the request

@return ListMetrics200Response

func (*MetricsAPIService) PostMetric

PostMetric Create a single metric

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiPostMetricRequest

func (*MetricsAPIService) PostMetricExecute

Execute executes the request

@return PostMetric200Response

func (*MetricsAPIService) PutMetric

func (a *MetricsAPIService) PutMetric(ctx context.Context, id interface{}) ApiPutMetricRequest

PutMetric Update a metric

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiPutMetricRequest

func (*MetricsAPIService) PutMetricExecute

Execute executes the request

@return PutMetric200Response

type OrganizationsAPIService

type OrganizationsAPIService service

OrganizationsAPIService OrganizationsAPI service

func (*OrganizationsAPIService) ListOrganizations

ListOrganizations Get all organizations (only for super admins on multi-org Enterprise Plan only)

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListOrganizationsRequest

func (*OrganizationsAPIService) ListOrganizationsExecute

Execute executes the request

@return ListOrganizations200Response

func (*OrganizationsAPIService) PostOrganization

PostOrganization Create a single organization (only for super admins on multi-org Enterprise Plan only)

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiPostOrganizationRequest

func (*OrganizationsAPIService) PostOrganizationExecute

Execute executes the request

@return PostOrganization200Response

func (*OrganizationsAPIService) PutOrganization

func (a *OrganizationsAPIService) PutOrganization(ctx context.Context, id interface{}) ApiPutOrganizationRequest

PutOrganization Edit a single organization (only for super admins on multi-org Enterprise Plan only)

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiPutOrganizationRequest

func (*OrganizationsAPIService) PutOrganizationExecute

Execute executes the request

@return PostOrganization200Response

type ProjectsAPIService

type ProjectsAPIService service

ProjectsAPIService ProjectsAPI service

func (*ProjectsAPIService) GetProject

GetProject Get a single project

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiGetProjectRequest

func (*ProjectsAPIService) GetProjectExecute

Execute executes the request

@return GetProject200Response

func (*ProjectsAPIService) ListProjects

ListProjects Get all projects

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListProjectsRequest

func (*ProjectsAPIService) ListProjectsExecute

Execute executes the request

@return ListProjects200Response

type SavedGroupsAPIService

type SavedGroupsAPIService service

SavedGroupsAPIService SavedGroupsAPI service

func (*SavedGroupsAPIService) DeleteSavedGroup

func (a *SavedGroupsAPIService) DeleteSavedGroup(ctx context.Context, id interface{}) ApiDeleteSavedGroupRequest

DeleteSavedGroup Deletes a single saved group

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiDeleteSavedGroupRequest

func (*SavedGroupsAPIService) DeleteSavedGroupExecute

Execute executes the request

@return DeleteMetric200Response

func (*SavedGroupsAPIService) GetSavedGroup

func (a *SavedGroupsAPIService) GetSavedGroup(ctx context.Context, id interface{}) ApiGetSavedGroupRequest

GetSavedGroup Get a single saved group

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiGetSavedGroupRequest

func (*SavedGroupsAPIService) GetSavedGroupExecute

Execute executes the request

@return PostSavedGroup200Response

func (*SavedGroupsAPIService) ListSavedGroups

ListSavedGroups Get all saved group

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListSavedGroupsRequest

func (*SavedGroupsAPIService) ListSavedGroupsExecute

Execute executes the request

@return ListSavedGroups200Response

func (*SavedGroupsAPIService) PostSavedGroup

PostSavedGroup Create a single saved group

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiPostSavedGroupRequest

func (*SavedGroupsAPIService) PostSavedGroupExecute

Execute executes the request

@return PostSavedGroup200Response

func (*SavedGroupsAPIService) UpdateSavedGroup

func (a *SavedGroupsAPIService) UpdateSavedGroup(ctx context.Context, id interface{}) ApiUpdateSavedGroupRequest

UpdateSavedGroup Partially update a single saved group

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiUpdateSavedGroupRequest

func (*SavedGroupsAPIService) UpdateSavedGroupExecute

Execute executes the request

@return PostSavedGroup200Response

type SdkConnectionsAPIService

type SdkConnectionsAPIService service

SdkConnectionsAPIService SdkConnectionsAPI service

func (*SdkConnectionsAPIService) GetSdkConnection

func (a *SdkConnectionsAPIService) GetSdkConnection(ctx context.Context, id interface{}) ApiGetSdkConnectionRequest

GetSdkConnection Get a single sdk connection

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiGetSdkConnectionRequest

func (*SdkConnectionsAPIService) GetSdkConnectionExecute

Execute executes the request

@return GetSdkConnection200Response

func (*SdkConnectionsAPIService) ListSdkConnections

ListSdkConnections Get all sdk connections

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListSdkConnectionsRequest

func (*SdkConnectionsAPIService) ListSdkConnectionsExecute

Execute executes the request

@return ListSdkConnections200Response

type SegmentsAPIService

type SegmentsAPIService service

SegmentsAPIService SegmentsAPI service

func (*SegmentsAPIService) GetSegment

func (a *SegmentsAPIService) GetSegment(ctx context.Context, id interface{}) ApiGetSegmentRequest

GetSegment Get a single segment

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiGetSegmentRequest

func (*SegmentsAPIService) GetSegmentExecute

Execute executes the request

@return GetSegment200Response

func (*SegmentsAPIService) ListSegments

ListSegments Get all segments

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListSegmentsRequest

func (*SegmentsAPIService) ListSegmentsExecute

Execute executes the request

@return ListSegments200Response

type ServerConfiguration

type ServerConfiguration struct {
	URL         string
	Description string
	Variables   map[string]ServerVariable
}

ServerConfiguration stores the information about a server

type ServerConfigurations

type ServerConfigurations []ServerConfiguration

ServerConfigurations stores multiple ServerConfiguration items

func (ServerConfigurations) URL

func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error)

URL formats template on a index using given variables

type ServerVariable

type ServerVariable struct {
	Description  string
	DefaultValue string
	EnumValues   []string
}

ServerVariable stores the information about a server variable

type VisualChangesetsAPIService

type VisualChangesetsAPIService service

VisualChangesetsAPIService VisualChangesetsAPI service

func (*VisualChangesetsAPIService) GetVisualChangeset

func (a *VisualChangesetsAPIService) GetVisualChangeset(ctx context.Context, id interface{}) ApiGetVisualChangesetRequest

GetVisualChangeset Get a single visual changeset

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiGetVisualChangesetRequest

func (*VisualChangesetsAPIService) GetVisualChangesetExecute

Execute executes the request

@return GetVisualChangeset200Response

func (*VisualChangesetsAPIService) ListVisualChangesets

ListVisualChangesets Get all visual changesets

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The experiment id the visual changesets belong to
@return ApiListVisualChangesetsRequest

func (*VisualChangesetsAPIService) ListVisualChangesetsExecute

Execute executes the request

@return ListVisualChangesets200Response

func (*VisualChangesetsAPIService) PostVisualChange

func (a *VisualChangesetsAPIService) PostVisualChange(ctx context.Context, id interface{}) ApiPostVisualChangeRequest

PostVisualChange Create a visual change for a visual changeset

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiPostVisualChangeRequest

func (*VisualChangesetsAPIService) PostVisualChangeExecute

Execute executes the request

@return PostVisualChange200Response

func (*VisualChangesetsAPIService) PutVisualChange

func (a *VisualChangesetsAPIService) PutVisualChange(ctx context.Context, id interface{}, visualChangeId interface{}) ApiPutVisualChangeRequest

PutVisualChange Update a visual change for a visual changeset

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@param visualChangeId Specify a specific visual change
@return ApiPutVisualChangeRequest

func (*VisualChangesetsAPIService) PutVisualChangeExecute

Execute executes the request

@return PostVisualChange200Response

func (*VisualChangesetsAPIService) PutVisualChangeset

func (a *VisualChangesetsAPIService) PutVisualChangeset(ctx context.Context, id interface{}) ApiPutVisualChangesetRequest

PutVisualChangeset Update a visual changeset

@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id The id of the requested resource
@return ApiPutVisualChangesetRequest

func (*VisualChangesetsAPIService) PutVisualChangesetExecute

Execute executes the request

@return PutVisualChangeset200Response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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