api

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

* DevCycle Bucketing API * * Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs. * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* DevCycle Bucketing API * * Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs. * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* DevCycle Bucketing API * * Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs. * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* DevCycle Bucketing API * * Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs. * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* DevCycle Bucketing API * * Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs. * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* DevCycle Bucketing API * * Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs. * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

Index

Constants

View Source
const (
	EventType_VariableEvaluated    = "variableEvaluated"
	EventType_AggVariableEvaluated = "aggVariableEvaluated"
	EventType_VariableDefaulted    = "variableDefaulted"
	EventType_AggVariableDefaulted = "aggVariableDefaulted"
	EventType_CustomEvent          = "customEvent"
)

Variables

This section is empty.

Functions

func ChunkSlice

func ChunkSlice(slice []Event, chunkSize int) [][]Event

Types

type BaseVariable

type BaseVariable struct {
	// Unique key by Project, can be used in the SDK / API to reference by 'key' rather than _id.
	Key string `json:"key"`
	// Variable type
	Type_ string `json:"type"`
	// Variable value can be a string, number, boolean, or JSON
	Value interface{} `json:"value"`
}

type BatchEventsBody

type BatchEventsBody struct {
	Batch []UserEventsBatchRecord `json:"batch"`
}

type BucketedUserConfig

type BucketedUserConfig struct {
	Project              Project                     `json:"project"`
	Environment          Environment                 `json:"environment"`
	Features             map[string]Feature          `json:"features"`
	FeatureVariationMap  map[string]string           `json:"featureVariationMap"`
	VariableVariationMap map[string]FeatureVariation `json:"variableVariationMap"`
	Variables            map[string]ReadOnlyVariable `json:"variables"`
	KnownVariableKeys    []float64                   `json:"knownVariableKeys"`

	User *User `json:"-"`
}

type EdgeDBSettings

type EdgeDBSettings struct {
	Enabled bool `json:"enabled"`
}

type Environment

type Environment struct {
	Id  string `json:"_id" validate:"required"`
	Key string `json:"key" validate:"required"`
}

type ErrorResponse

type ErrorResponse struct {
	// Error message
	Message string `json:"message"`
	// Additional error information detailing the error reasoning
	Data interface{} `json:"data,omitempty"`
}

type Event

type Event struct {
	Type_       string                 `json:"type"`
	Target      string                 `json:"target,omitempty"`
	CustomType  string                 `json:"customType,omitempty"`
	UserId      string                 `json:"user_id"`
	ClientDate  time.Time              `json:"clientDate"`
	Value       float64                `json:"value,omitempty"`
	FeatureVars map[string]string      `json:"featureVars"`
	MetaData    map[string]interface{} `json:"metaData,omitempty"`
}

type EventQueueOptions

type EventQueueOptions struct {
	FlushEventsInterval          time.Duration `json:"flushEventsMS"`
	DisableAutomaticEventLogging bool          `json:"disableAutomaticEventLogging"`
	DisableCustomEventLogging    bool          `json:"disableCustomEventLogging"`
	MaxEventQueueSize            int           `json:"maxEventsPerFlush,omitempty"`
	FlushEventQueueSize          int           `json:"minEventsPerFlush,omitempty"`
	EventRequestChunkSize        int           `json:"eventRequestChunkSize,omitempty"`
	EventsAPIBasePath            string        `json:"eventsAPIBasePath,omitempty"`
}

func (*EventQueueOptions) CheckBounds

func (o *EventQueueOptions) CheckBounds()

func (*EventQueueOptions) IsEventLoggingDisabled

func (o *EventQueueOptions) IsEventLoggingDisabled(eventType string) bool

type Feature

type Feature struct {
	// unique database id
	Id string `json:"_id"`
	// Unique key by Project, can be used in the SDK / API to reference by 'key' rather than _id.
	Key string `json:"key"`
	// Feature type
	Type_ string `json:"type"`
	// Bucketed feature variation
	Variation string `json:"_variation"`
	// Bucketed feature variation key
	VariationKey string `json:"variationKey"`
	// Bucketed feature variation name
	VariationName string `json:"variationName"`
	// Evaluation reasoning
	EvalReason string `json:"evalReason,omitempty"`
}

type FeatureVariation

type FeatureVariation struct {
	Feature   string `json:"_feature"`
	Variation string `json:"_variation"`
}

type FlushPayload

type FlushPayload struct {
	PayloadId  string                  `json:"payloadId"`
	EventCount int                     `json:"eventCount"`
	Records    []UserEventsBatchRecord `json:"records"`
	Status     string
}

func (*FlushPayload) AddBatchRecordForUser

func (fp *FlushPayload) AddBatchRecordForUser(record UserEventsBatchRecord, chunkSize int)

type OptInColors

type OptInColors struct {
	Primary   string `json:"primary"`
	Secondary string `json:"secondary"`
}

type OptInSettings

type OptInSettings struct {
	Enabled     bool        `json:"enabled"`
	Title       string      `json:"title"`
	Description string      `json:"description"`
	ImageURL    string      `json:"imageURL"`
	Colors      OptInColors `json:"colors"`
}

type PlatformData

type PlatformData struct {
	SdkType         string `json:"sdkType"`
	SdkVersion      string `json:"sdkVersion"`
	PlatformVersion string `json:"platformVersion"`
	DeviceModel     string `json:"deviceModel"`
	Platform        string `json:"platform"`
	Hostname        string `json:"hostname"`
}

func (PlatformData) Default

func (p PlatformData) Default() *PlatformData

type PopulatedUser

type PopulatedUser struct {
	User
	*PlatformData
	// Date the user was created, Unix epoch timestamp format
	CreatedDate time.Time `json:"createdDate,omitempty"`
}

func (*PopulatedUser) CombinedCustomData

func (p *PopulatedUser) CombinedCustomData() map[string]interface{}

func (*PopulatedUser) MergeClientCustomData

func (p *PopulatedUser) MergeClientCustomData(ccd map[string]interface{})

type Project

type Project struct {
	Id               string          `json:"_id" validate:"required"`
	Key              string          `json:"key" validate:"required"`
	A0OrganizationId string          `json:"a0_organization" validate:"required"`
	Settings         ProjectSettings `json:"settings" validate:"required"`
}

type ProjectSettings

type ProjectSettings struct {
	EdgeDB EdgeDBSettings `json:"edgeDB"`
	OptIn  OptInSettings  `json:"optIn"`
}

type ReadOnlyVariable

type ReadOnlyVariable struct {
	BaseVariable
	// unique database id
	Id string `json:"_id"`
}

type User

type User struct {
	// Unique id to identify the user
	UserId string `json:"user_id"`
	// User's email used to identify the user on the dashboard / target audiences
	Email string `json:"email,omitempty"`
	// User's name used to identify the user on the dashboard / target audiences
	Name string `json:"name,omitempty"`
	// User's language in ISO 639-1 format
	Language string `json:"language,omitempty"`
	// User's country in ISO 3166 alpha-2 format
	Country string `json:"country,omitempty"`
	// App Version of the running application
	AppVersion string `json:"appVersion,omitempty"`
	// App Build number of the running application
	AppBuild string `json:"appBuild,omitempty"`
	// User's custom data to target the user with, data will be logged to DevCycle for use in dashboard.
	CustomData map[string]interface{} `json:"customData,omitempty"`
	// User's custom data to target the user with, data will not be logged to DevCycle only used for feature bucketing.
	PrivateCustomData map[string]interface{} `json:"privateCustomData,omitempty"`
	// User's device model
	DeviceModel string `json:"deviceModel,omitempty"`
	// Date the user was created, Unix epoch timestamp format
	LastSeenDate time.Time `json:"lastSeenDate,omitempty"`
}

func (User) GetPopulatedUser

func (user User) GetPopulatedUser(platformData *PlatformData) PopulatedUser

func (User) GetPopulatedUserWithTime

func (user User) GetPopulatedUserWithTime(platformData *PlatformData, createDate time.Time) PopulatedUser

GetPopulatedUserWithTime returns a populated user with a specific created date

type UserDataAndEventsBody

type UserDataAndEventsBody struct {
	Events []Event        `json:"events,omitempty"`
	User   *PopulatedUser `json:"user,omitempty"`
}

type UserEventsBatchRecord

type UserEventsBatchRecord struct {
	User   PopulatedUser `json:"user"`
	Events []Event       `json:"events"`
}

type UserFeatureData

type UserFeatureData struct {
	User        User `json:"user"`
	FeatureVars map[string]string
}

type Variable

type Variable struct {
	BaseVariable
	// Default variable value can be a string, number, boolean, or JSON
	DefaultValue interface{} `json:"defaultValue"`
	// Identifies if variable was returned with the default value
	IsDefaulted bool `json:"isDefaulted"`
}

Jump to

Keyboard shortcuts

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