Documentation
¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type BasicAuth
- type Configuration
- type Constraint
- type ConstraintApiService
- func (a *ConstraintApiService) CreateConstraint(ctx context.Context, flagID int64, segmentID int64, ...) (Constraint, *http.Response, error)
- func (a *ConstraintApiService) DeleteConstraint(ctx context.Context, flagID int64, segmentID int64, constraintID int64) (*http.Response, error)
- func (a *ConstraintApiService) FindConstraints(ctx context.Context, flagID int64, segmentID int64) ([]Constraint, *http.Response, error)
- func (a *ConstraintApiService) PutConstraint(ctx context.Context, flagID int64, segmentID int64, constraintID int64, ...) (Constraint, *http.Response, error)
- type CreateConstraintRequest
- type CreateFlagRequest
- type CreateSegmentRequest
- type CreateTagRequest
- type CreateVariantRequest
- type DatarApiService
- func (a *DatarApiService) GetDatarFlagSummary(ctx context.Context, flagID int64, localVarOptionals *GetDatarFlagSummaryOpts) (DatarFlagSummaryResponse, *http.Response, error)
- func (a *DatarApiService) GetDatarSummary(ctx context.Context, localVarOptionals *GetDatarSummaryOpts) (DatarSummaryResponse, *http.Response, error)
- type DatarDayEntry
- type DatarFlagSummaryResponse
- type DatarSegmentEntry
- type DatarSummaryFlag
- type DatarSummaryResponse
- type DatarVariantEntry
- type Distribution
- type DistributionApiService
- type DuplicateFlagOpts
- type DuplicateFlagRequest
- type EvalContext
- type EvalDebugLog
- type EvalResult
- type EvaluationApiService
- func (a *EvaluationApiService) GetEvaluation(ctx context.Context, json string) (EvalResult, *http.Response, error)
- func (a *EvaluationApiService) GetEvaluationBatch(ctx context.Context, json string) (EvaluationBatchResponse, *http.Response, error)
- func (a *EvaluationApiService) PostEvaluation(ctx context.Context, body EvalContext) (EvalResult, *http.Response, error)
- func (a *EvaluationApiService) PostEvaluationBatch(ctx context.Context, body EvaluationBatchRequest) (EvaluationBatchResponse, *http.Response, error)
- type EvaluationBatchRequest
- type EvaluationBatchResponse
- type EvaluationEntity
- type ExportApiService
- type Exposure
- type ExposureApiService
- type ExposureRowError
- type ExposuresRequest
- type ExposuresResponse
- type FindAllTagsOpts
- type FindFlagsOpts
- type Flag
- type FlagApiService
- func (a *FlagApiService) CreateFlag(ctx context.Context, body CreateFlagRequest) (Flag, *http.Response, error)
- func (a *FlagApiService) DeleteFlag(ctx context.Context, flagID int64) (*http.Response, error)
- func (a *FlagApiService) DuplicateFlag(ctx context.Context, flagID int64, localVarOptionals *DuplicateFlagOpts) (Flag, *http.Response, error)
- func (a *FlagApiService) FindFlags(ctx context.Context, localVarOptionals *FindFlagsOpts) ([]Flag, *http.Response, error)
- func (a *FlagApiService) GetFlag(ctx context.Context, flagID int64) (Flag, *http.Response, error)
- func (a *FlagApiService) GetFlagEntityTypes(ctx context.Context) ([]string, *http.Response, error)
- func (a *FlagApiService) GetFlagSnapshotMaxID(ctx context.Context) (FlagSnapshotMaxId, *http.Response, error)
- func (a *FlagApiService) GetFlagSnapshots(ctx context.Context, flagID int64, localVarOptionals *GetFlagSnapshotsOpts) ([]FlagSnapshot, *http.Response, error)
- func (a *FlagApiService) PutFlag(ctx context.Context, flagID int64, body PutFlagRequest) (Flag, *http.Response, error)
- func (a *FlagApiService) RestoreFlag(ctx context.Context, flagID int64) (Flag, *http.Response, error)
- func (a *FlagApiService) SetFlagEnabled(ctx context.Context, flagID int64, body SetFlagEnabledRequest) (Flag, *http.Response, error)
- type FlagSnapshot
- type FlagSnapshotMaxId
- type GenericSwaggerError
- type GetDatarFlagSummaryOpts
- type GetDatarSummaryOpts
- type GetExportEvalCacheJSONOpts
- type GetExportSqliteOpts
- type GetFlagSnapshotsOpts
- type Health
- type HealthApiService
- type ModelError
- type PutDistributionsRequest
- type PutFlagRequest
- type PutSegmentReorderRequest
- type PutSegmentRequest
- type PutVariantRequest
- type Segment
- type SegmentApiService
- func (a *SegmentApiService) CreateSegment(ctx context.Context, flagID int64, body CreateSegmentRequest) (Segment, *http.Response, error)
- func (a *SegmentApiService) DeleteSegment(ctx context.Context, flagID int64, segmentID int64) (*http.Response, error)
- func (a *SegmentApiService) FindSegments(ctx context.Context, flagID int64) ([]Segment, *http.Response, error)
- func (a *SegmentApiService) PutSegment(ctx context.Context, flagID int64, segmentID int64, body PutSegmentRequest) (Segment, *http.Response, error)
- func (a *SegmentApiService) PutSegmentsReorder(ctx context.Context, flagID int64, body PutSegmentReorderRequest) (*http.Response, error)
- type SegmentDebugLog
- type SetFlagEnabledRequest
- type Tag
- type TagApiService
- func (a *TagApiService) CreateTag(ctx context.Context, flagID int64, body CreateTagRequest) (Tag, *http.Response, error)
- func (a *TagApiService) DeleteTag(ctx context.Context, flagID int64, tagID int64) (*http.Response, error)
- func (a *TagApiService) FindAllTags(ctx context.Context, localVarOptionals *FindAllTagsOpts) ([]Tag, *http.Response, error)
- func (a *TagApiService) FindTags(ctx context.Context, flagID int64) ([]Tag, *http.Response, error)
- type Variant
- type VariantApiService
- func (a *VariantApiService) CreateVariant(ctx context.Context, flagID int64, body CreateVariantRequest) (Variant, *http.Response, error)
- func (a *VariantApiService) DeleteVariant(ctx context.Context, flagID int64, variantID int64) (*http.Response, error)
- func (a *VariantApiService) FindVariants(ctx context.Context, flagID int64) ([]Variant, *http.Response, error)
- func (a *VariantApiService) PutVariant(ctx context.Context, flagID int64, variantID int64, body PutVariantRequest) (Variant, *http.Response, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // 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") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct {
ConstraintApi *ConstraintApiService
DatarApi *DatarApiService
DistributionApi *DistributionApiService
EvaluationApi *EvaluationApiService
ExportApi *ExportApiService
ExposureApi *ExposureApiService
FlagApi *FlagApiService
HealthApi *HealthApiService
SegmentApi *SegmentApiService
TagApi *TagApiService
VariantApi *VariantApiService
// contains filtered or unexported fields
}
APIClient manages communication with the Flagr API v1.2.2 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) ChangeBasePath ¶
Change base path to allow switching to mocks
type APIKey ¶
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 swagger 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:"-"`
}
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
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 {
BasePath string `json:"basePath,omitempty"`
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
HTTPClient *http.Client
}
func NewConfiguration ¶
func NewConfiguration() *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
type Constraint ¶
type Constraint struct {
Id int64 `json:"id,omitempty"`
// The property name from the entity context to evaluate. Supports nested field access: use dots (e.g., `user.name`) for nested objects and brackets (e.g., `users[0]`) for array indices.
Property string `json:"property"`
Operator string `json:"operator"`
Value string `json:"value"`
}
type ConstraintApiService ¶
type ConstraintApiService service
func (*ConstraintApiService) CreateConstraint ¶
func (a *ConstraintApiService) CreateConstraint(ctx context.Context, flagID int64, segmentID int64, body CreateConstraintRequest) (Constraint, *http.Response, error)
ConstraintApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param segmentID numeric ID of the segment
- @param body create a constraint
@return Constraint
func (*ConstraintApiService) DeleteConstraint ¶
func (a *ConstraintApiService) DeleteConstraint(ctx context.Context, flagID int64, segmentID int64, constraintID int64) (*http.Response, error)
ConstraintApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param segmentID numeric ID of the segment
- @param constraintID numeric ID of the constraint
func (*ConstraintApiService) FindConstraints ¶
func (a *ConstraintApiService) FindConstraints(ctx context.Context, flagID int64, segmentID int64) ([]Constraint, *http.Response, error)
ConstraintApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param segmentID numeric ID of the segment
@return []Constraint
func (*ConstraintApiService) PutConstraint ¶
func (a *ConstraintApiService) PutConstraint(ctx context.Context, flagID int64, segmentID int64, constraintID int64, body CreateConstraintRequest) (Constraint, *http.Response, error)
ConstraintApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param segmentID numeric ID of the segment
- @param constraintID numeric ID of the constraint
- @param body create a constraint
@return Constraint
type CreateConstraintRequest ¶
type CreateConstraintRequest struct {
// The property name from the entity context to evaluate. Supports nested field access: use dots (e.g., `user.name`) for nested objects and brackets (e.g., `users[0]`) for array indices.
Property string `json:"property"`
Operator string `json:"operator"`
Value string `json:"value"`
}
type CreateFlagRequest ¶
type CreateSegmentRequest ¶
type CreateTagRequest ¶
type CreateTagRequest struct {
Value string `json:"value"`
}
type CreateVariantRequest ¶
type CreateVariantRequest struct {
Key string `json:"key"`
Attachment *interface{} `json:"attachment,omitempty"`
}
type DatarApiService ¶
type DatarApiService service
func (*DatarApiService) GetDatarFlagSummary ¶
func (a *DatarApiService) GetDatarFlagSummary(ctx context.Context, flagID int64, localVarOptionals *GetDatarFlagSummaryOpts) (DatarFlagSummaryResponse, *http.Response, error)
func (*DatarApiService) GetDatarSummary ¶
func (a *DatarApiService) GetDatarSummary(ctx context.Context, localVarOptionals *GetDatarSummaryOpts) (DatarSummaryResponse, *http.Response, error)
type DatarDayEntry ¶
type DatarFlagSummaryResponse ¶
type DatarFlagSummaryResponse struct {
FlagID int64 `json:"flagID,omitempty"`
TrafficByVariant []DatarVariantEntry `json:"trafficByVariant,omitempty"`
TrafficBySegment []DatarSegmentEntry `json:"trafficBySegment,omitempty"`
TrafficByDay []DatarDayEntry `json:"trafficByDay,omitempty"`
}
type DatarSegmentEntry ¶
type DatarSummaryFlag ¶
type DatarSummaryFlag struct {
FlagID int64 `json:"flagID,omitempty"`
FlagKey string `json:"flagKey,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Description string `json:"description,omitempty"`
TotalEvalCount int64 `json:"totalEvalCount,omitempty"`
LastEvaluatedAt time.Time `json:"lastEvaluatedAt,omitempty"`
}
type DatarSummaryResponse ¶
type DatarSummaryResponse struct {
Flags []DatarSummaryFlag `json:"flags,omitempty"`
}
type DatarVariantEntry ¶
type Distribution ¶
type DistributionApiService ¶
type DistributionApiService service
func (*DistributionApiService) FindDistributions ¶
func (a *DistributionApiService) FindDistributions(ctx context.Context, flagID int64, segmentID int64) ([]Distribution, *http.Response, error)
DistributionApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param segmentID numeric ID of the segment
@return []Distribution
func (*DistributionApiService) PutDistributions ¶
func (a *DistributionApiService) PutDistributions(ctx context.Context, flagID int64, segmentID int64, body PutDistributionsRequest) ([]Distribution, *http.Response, error)
DistributionApiService replace the distribution with the new setting
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param segmentID numeric ID of the segment
- @param body array of distributions
@return []Distribution
type DuplicateFlagOpts ¶
type DuplicateFlagRequest ¶
type EvalContext ¶
type EvalContext struct {
// entityID is used to deterministically at random to evaluate the flag result. If it's empty, flagr will randomly generate one.
EntityID string `json:"entityID,omitempty"`
EntityType string `json:"entityType,omitempty"`
EntityContext *interface{} `json:"entityContext,omitempty"`
EnableDebug bool `json:"enableDebug,omitempty"`
// flagID
FlagID int64 `json:"flagID,omitempty"`
// flagKey. flagID or flagKey will resolve to the same flag. Either works.
FlagKey string `json:"flagKey,omitempty"`
// flagTags. flagTags looks up flags by tag. Either works.
FlagTags []string `json:"flagTags,omitempty"`
// determine how flagTags is used to filter flags to be evaluated. OR extends the evaluation to those which contains at least one of the provided flagTags or AND limit the evaluation to those which contains all the flagTags.
FlagTagsOperator string `json:"flagTagsOperator,omitempty"`
}
type EvalDebugLog ¶
type EvalDebugLog struct {
SegmentDebugLogs []SegmentDebugLog `json:"segmentDebugLogs,omitempty"`
Msg string `json:"msg,omitempty"`
}
type EvalResult ¶
type EvalResult struct {
FlagID int64 `json:"flagID,omitempty"`
FlagKey string `json:"flagKey,omitempty"`
FlagSnapshotID int64 `json:"flagSnapshotID,omitempty"`
// flagTags. flagTags looks up flags by tag. Either works.
FlagTags []string `json:"flagTags,omitempty"`
SegmentID int64 `json:"segmentID,omitempty"`
VariantID int64 `json:"variantID,omitempty"`
VariantKey string `json:"variantKey,omitempty"`
// evaluation for eval API results; exposure for client-reported impressions via POST /exposures (same data recorders as eval)
RecordSource string `json:"recordSource,omitempty"`
VariantAttachment *interface{} `json:"variantAttachment,omitempty"`
EvalContext *EvalContext `json:"evalContext,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
EvalDebugLog *EvalDebugLog `json:"evalDebugLog,omitempty"`
// Whether data records (impression logging) are enabled for this flag.
DataRecordsEnabled bool `json:"dataRecordsEnabled,omitempty"`
}
type EvaluationApiService ¶
type EvaluationApiService service
func (*EvaluationApiService) GetEvaluation ¶
func (a *EvaluationApiService) GetEvaluation(ctx context.Context, json string) (EvalResult, *http.Response, error)
EvaluationApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param json Percent-encoded (URI-encoded) JSON matching POST /evaluation body (evalContext). Example: ?json=%7B%22entityID%22%3A%22u1%22%2C%22flagID%22%3A1%7D decodes to {\"entityID\":\"u1\",\"flagID\":1}.
@return EvalResult
func (*EvaluationApiService) GetEvaluationBatch ¶
func (a *EvaluationApiService) GetEvaluationBatch(ctx context.Context, json string) (EvaluationBatchResponse, *http.Response, error)
EvaluationApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param json Percent-encoded (URI-encoded) JSON matching POST /evaluation/batch body (evaluationBatchRequest). Example: ?json=%7B%22entities%22%3A%5B%7B%22entityID%22%3A%22u1%22%7D%5D%2C%22flagIDs%22%3A%5B1%5D%7D decodes to {\"entities\":[{\"entityID\":\"u1\"}],\"flagIDs\":[1]}.
@return EvaluationBatchResponse
func (*EvaluationApiService) PostEvaluation ¶
func (a *EvaluationApiService) PostEvaluation(ctx context.Context, body EvalContext) (EvalResult, *http.Response, error)
EvaluationApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body evaluation context
@return EvalResult
func (*EvaluationApiService) PostEvaluationBatch ¶
func (a *EvaluationApiService) PostEvaluationBatch(ctx context.Context, body EvaluationBatchRequest) (EvaluationBatchResponse, *http.Response, error)
EvaluationApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body evaluation batch request
@return EvaluationBatchResponse
type EvaluationBatchRequest ¶
type EvaluationBatchRequest struct {
Entities []EvaluationEntity `json:"entities"`
EnableDebug bool `json:"enableDebug,omitempty"`
// flagIDs
FlagIDs []int64 `json:"flagIDs,omitempty"`
// flagKeys. Either flagIDs, flagKeys or flagTags works. If pass in multiples, Flagr may return duplicate results.
FlagKeys []string `json:"flagKeys,omitempty"`
// flagTags. Either flagIDs, flagKeys or flagTags works. If pass in multiples, Flagr may return duplicate results.
FlagTags []string `json:"flagTags,omitempty"`
// determine how flagTags is used to filter flags to be evaluated. OR extends the evaluation to those which contains at least one of the provided flagTags or AND limit the evaluation to those which contains all the flagTags.
FlagTagsOperator string `json:"flagTagsOperator,omitempty"`
}
type EvaluationBatchResponse ¶
type EvaluationBatchResponse struct {
EvaluationResults []EvalResult `json:"evaluationResults"`
}
type EvaluationEntity ¶
type ExportApiService ¶
type ExportApiService service
func (*ExportApiService) GetExportEvalCacheJSON ¶
func (a *ExportApiService) GetExportEvalCacheJSON(ctx context.Context, localVarOptionals *GetExportEvalCacheJSONOpts) (interface{}, *http.Response, error)
func (*ExportApiService) GetExportSqlite ¶
func (a *ExportApiService) GetExportSqlite(ctx context.Context, localVarOptionals *GetExportSqliteOpts) (*os.File, *http.Response, error)
type Exposure ¶
type Exposure struct {
FlagID int64 `json:"flagID,omitempty"`
FlagKey string `json:"flagKey,omitempty"`
VariantID int64 `json:"variantID,omitempty"`
VariantKey string `json:"variantKey,omitempty"`
EntityID string `json:"entityID"`
EntityType string `json:"entityType,omitempty"`
// Optional attributes recorded on evalContext.entityContext (same field as POST /evaluation). Include impression-specific keys here (e.g. page path); exposure does not re-run segment constraints.
EntityContext *interface{} `json:"entityContext,omitempty"`
FlagSnapshotID int64 `json:"flagSnapshotID,omitempty"`
Timestamp time.Time `json:"timestamp,omitempty"`
}
type ExposureApiService ¶
type ExposureApiService service
func (*ExposureApiService) PostExposures ¶
func (a *ExposureApiService) PostExposures(ctx context.Context, body ExposuresRequest) (ExposuresResponse, *http.Response, error)
ExposureApiService Log exposures (batch) Log when a user actually saw a flag or variant (impression), typically after POST /evaluation. Integrates with the data recorder when FLAGR_RECORDER_ENABLED and per-flag dataRecordsEnabled are set.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body
@return ExposuresResponse
type ExposureRowError ¶
type ExposuresRequest ¶
type ExposuresRequest struct {
Exposures []Exposure `json:"exposures"`
}
type ExposuresResponse ¶
type ExposuresResponse struct {
LoggedCount int64 `json:"loggedCount,omitempty"`
Message string `json:"message,omitempty"`
Errors []ExposureRowError `json:"errors,omitempty"`
}
type FindAllTagsOpts ¶
type FindFlagsOpts ¶
type Flag ¶
type Flag struct {
Id int64 `json:"id,omitempty"`
// unique key representation of the flag
Key string `json:"key,omitempty"`
Description string `json:"description"`
Enabled bool `json:"enabled"`
Tags []Tag `json:"tags,omitempty"`
Segments []Segment `json:"segments,omitempty"`
Variants []Variant `json:"variants,omitempty"`
// when true and FLAGR_RECORDER_ENABLED is set, evaluation and exposure rows are written to configured data recorders (e.g. kafka).
DataRecordsEnabled bool `json:"dataRecordsEnabled"`
// it will override the entityType in the evaluation logs if it's not empty
EntityType string `json:"entityType,omitempty"`
// flag usage details in markdown format
Notes string `json:"notes,omitempty"`
CreatedBy string `json:"createdBy,omitempty"`
UpdatedBy string `json:"updatedBy,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
type FlagApiService ¶
type FlagApiService service
func (*FlagApiService) CreateFlag ¶
func (a *FlagApiService) CreateFlag(ctx context.Context, body CreateFlagRequest) (Flag, *http.Response, error)
FlagApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body create a flag
@return Flag
func (*FlagApiService) DeleteFlag ¶
FlagApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
func (*FlagApiService) DuplicateFlag ¶
func (a *FlagApiService) DuplicateFlag(ctx context.Context, flagID int64, localVarOptionals *DuplicateFlagOpts) (Flag, *http.Response, error)
func (*FlagApiService) FindFlags ¶
func (a *FlagApiService) FindFlags(ctx context.Context, localVarOptionals *FindFlagsOpts) ([]Flag, *http.Response, error)
func (*FlagApiService) GetFlag ¶
FlagApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag to get
@return Flag
func (*FlagApiService) GetFlagEntityTypes ¶
FlagApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []string
func (*FlagApiService) GetFlagSnapshotMaxID ¶
func (a *FlagApiService) GetFlagSnapshotMaxID(ctx context.Context) (FlagSnapshotMaxId, *http.Response, error)
FlagApiService Get the max flag snapshot ID (config change version) Returns the highest (most recent) flag_snapshot id. flag_snapshot is an append-only changelog — every flag configuration mutation (create, update, delete, restore of flags, segments, variants, constraints, distributions, or tags) inserts a new row with a monotonically increasing id. This makes the max id a lightweight single source of truth for detecting any configuration change. Consumers can store this value and poll it periodically: if the value changes, at least one flag's configuration has been modified and caches should be invalidated. This is vastly more efficient than polling the flags list or individual flags.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return FlagSnapshotMaxId
func (*FlagApiService) GetFlagSnapshots ¶
func (a *FlagApiService) GetFlagSnapshots(ctx context.Context, flagID int64, localVarOptionals *GetFlagSnapshotsOpts) ([]FlagSnapshot, *http.Response, error)
func (*FlagApiService) PutFlag ¶
func (a *FlagApiService) PutFlag(ctx context.Context, flagID int64, body PutFlagRequest) (Flag, *http.Response, error)
FlagApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag to get
- @param body update a flag
@return Flag
func (*FlagApiService) RestoreFlag ¶
func (a *FlagApiService) RestoreFlag(ctx context.Context, flagID int64) (Flag, *http.Response, error)
FlagApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag to get
@return Flag
func (*FlagApiService) SetFlagEnabled ¶
func (a *FlagApiService) SetFlagEnabled(ctx context.Context, flagID int64, body SetFlagEnabledRequest) (Flag, *http.Response, error)
FlagApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag to get
- @param body set flag enabled state
@return Flag
type FlagSnapshot ¶
type FlagSnapshotMaxId ¶
type FlagSnapshotMaxId struct {
MaxID int64 `json:"maxID,omitempty"`
}
type GenericSwaggerError ¶
type GenericSwaggerError struct {
// contains filtered or unexported fields
}
GenericSwaggerError Provides access to the body, error and model on returned errors.
func (GenericSwaggerError) Body ¶
func (e GenericSwaggerError) Body() []byte
Body returns the raw bytes of the response
func (GenericSwaggerError) Error ¶
func (e GenericSwaggerError) Error() string
Error returns non-empty string if there was an error.
func (GenericSwaggerError) Model ¶
func (e GenericSwaggerError) Model() interface{}
Model returns the unpacked model of the error
type GetDatarFlagSummaryOpts ¶
type GetDatarSummaryOpts ¶
type GetExportSqliteOpts ¶
type GetFlagSnapshotsOpts ¶
type HealthApiService ¶
type HealthApiService service
type ModelError ¶
type ModelError struct {
Message string `json:"message"`
}
type PutDistributionsRequest ¶
type PutDistributionsRequest struct {
Distributions []Distribution `json:"distributions"`
}
type PutFlagRequest ¶
type PutFlagRequest struct {
Description string `json:"description,omitempty"`
// when true and FLAGR_RECORDER_ENABLED is set, evaluation and exposure rows are written to configured data recorders (e.g. kafka).
DataRecordsEnabled bool `json:"dataRecordsEnabled,omitempty"`
// it will overwrite entityType into evaluation logs if it's not empty
EntityType string `json:"entityType,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Key string `json:"key,omitempty"`
Notes string `json:"notes,omitempty"`
}
type PutSegmentReorderRequest ¶
type PutSegmentReorderRequest struct {
SegmentIDs []int64 `json:"segmentIDs"`
}
type PutSegmentRequest ¶
type PutVariantRequest ¶
type PutVariantRequest struct {
Key string `json:"key"`
Attachment *interface{} `json:"attachment,omitempty"`
}
type Segment ¶
type Segment struct {
Id int64 `json:"id,omitempty"`
Description string `json:"description"`
Constraints []Constraint `json:"constraints,omitempty"`
Distributions []Distribution `json:"distributions,omitempty"`
Rank int64 `json:"rank"`
RolloutPercent int64 `json:"rolloutPercent"`
}
type SegmentApiService ¶
type SegmentApiService service
func (*SegmentApiService) CreateSegment ¶
func (a *SegmentApiService) CreateSegment(ctx context.Context, flagID int64, body CreateSegmentRequest) (Segment, *http.Response, error)
SegmentApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag to get
- @param body create a segment under a flag
@return Segment
func (*SegmentApiService) DeleteSegment ¶
func (a *SegmentApiService) DeleteSegment(ctx context.Context, flagID int64, segmentID int64) (*http.Response, error)
SegmentApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param segmentID numeric ID of the segment
func (*SegmentApiService) FindSegments ¶
func (a *SegmentApiService) FindSegments(ctx context.Context, flagID int64) ([]Segment, *http.Response, error)
SegmentApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag to get
@return []Segment
func (*SegmentApiService) PutSegment ¶
func (a *SegmentApiService) PutSegment(ctx context.Context, flagID int64, segmentID int64, body PutSegmentRequest) (Segment, *http.Response, error)
SegmentApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param segmentID numeric ID of the segment
- @param body update a segment
@return Segment
func (*SegmentApiService) PutSegmentsReorder ¶
func (a *SegmentApiService) PutSegmentsReorder(ctx context.Context, flagID int64, body PutSegmentReorderRequest) (*http.Response, error)
SegmentApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param body reorder segments
type SegmentDebugLog ¶
type SetFlagEnabledRequest ¶
type SetFlagEnabledRequest struct {
Enabled bool `json:"enabled"`
}
type TagApiService ¶
type TagApiService service
func (*TagApiService) CreateTag ¶
func (a *TagApiService) CreateTag(ctx context.Context, flagID int64, body CreateTagRequest) (Tag, *http.Response, error)
TagApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param body create a tag
@return Tag
func (*TagApiService) DeleteTag ¶
func (a *TagApiService) DeleteTag(ctx context.Context, flagID int64, tagID int64) (*http.Response, error)
TagApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param tagID numeric ID of the tag
func (*TagApiService) FindAllTags ¶
func (a *TagApiService) FindAllTags(ctx context.Context, localVarOptionals *FindAllTagsOpts) ([]Tag, *http.Response, error)
type VariantApiService ¶
type VariantApiService service
func (*VariantApiService) CreateVariant ¶
func (a *VariantApiService) CreateVariant(ctx context.Context, flagID int64, body CreateVariantRequest) (Variant, *http.Response, error)
VariantApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param body create a variant
@return Variant
func (*VariantApiService) DeleteVariant ¶
func (a *VariantApiService) DeleteVariant(ctx context.Context, flagID int64, variantID int64) (*http.Response, error)
VariantApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param variantID numeric ID of the variant
func (*VariantApiService) FindVariants ¶
func (a *VariantApiService) FindVariants(ctx context.Context, flagID int64) ([]Variant, *http.Response, error)
VariantApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
@return []Variant
func (*VariantApiService) PutVariant ¶
func (a *VariantApiService) PutVariant(ctx context.Context, flagID int64, variantID int64, body PutVariantRequest) (Variant, *http.Response, error)
VariantApiService
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param flagID numeric ID of the flag
- @param variantID numeric ID of the variant
- @param body update a variant
@return Variant
Source Files
¶
- api_constraint.go
- api_datar.go
- api_distribution.go
- api_evaluation.go
- api_export.go
- api_exposure.go
- api_flag.go
- api_health.go
- api_segment.go
- api_tag.go
- api_variant.go
- client.go
- configuration.go
- model_constraint.go
- model_create_constraint_request.go
- model_create_flag_request.go
- model_create_segment_request.go
- model_create_tag_request.go
- model_create_variant_request.go
- model_datar_day_entry.go
- model_datar_flag_summary_response.go
- model_datar_segment_entry.go
- model_datar_summary_flag.go
- model_datar_summary_response.go
- model_datar_variant_entry.go
- model_distribution.go
- model_duplicate_flag_request.go
- model_error.go
- model_eval_context.go
- model_eval_debug_log.go
- model_eval_result.go
- model_evaluation_batch_request.go
- model_evaluation_batch_response.go
- model_evaluation_entity.go
- model_exposure.go
- model_exposure_row_error.go
- model_exposures_request.go
- model_exposures_response.go
- model_flag.go
- model_flag_snapshot.go
- model_flag_snapshot_max_id.go
- model_health.go
- model_put_distributions_request.go
- model_put_flag_request.go
- model_put_segment_reorder_request.go
- model_put_segment_request.go
- model_put_variant_request.go
- model_segment.go
- model_segment_debug_log.go
- model_set_flag_enabled_request.go
- model_tag.go
- model_variant.go
- response.go