Documentation
¶
Index ¶
- Constants
- Variables
- func CheckResponse(r *http.Response) error
- func ErrRequiredParam(param string) error
- type AddUserRoleResponse
- type AllApiTokensResponse
- type AllFeatureTypesResponse
- type AllStrategiesResponse
- type ApiClient
- type ApiToken
- type ApiTokenService
- func (p *ApiTokenService) CreateApiToken(token ApiToken) (*ApiToken, *Response, error)
- func (p *ApiTokenService) DeleteApiToken(secret string) (bool, *Response, error)
- func (p *ApiTokenService) GetAllApiTokens() (*AllApiTokensResponse, *Response, error)
- func (p *ApiTokenService) UpdateApiToken(secret string, token ApiToken) (bool, *Response, error)
- type CreateProjectResponse
- type Environment
- type ErrorResponse
- type FeatureStrategy
- type FeatureTag
- type FeatureTagsResponse
- type FeatureTagsService
- func (p *FeatureTagsService) CreateFeatureTags(featureName string, tag FeatureTag) (*FeatureTag, *Response, error)
- func (p *FeatureTagsService) DeleteFeatureTags(featureName string, tag FeatureTag) (*Response, error)
- func (p *FeatureTagsService) GetAllFeatureTags(featureName string) (*FeatureTagsResponse, *Response, error)
- func (p *FeatureTagsService) UpdateFeatureTags(featureName string, addedTags []FeatureTag, removedTags []FeatureTag) (*FeatureTagsResponse, *Response, error)
- type FeatureToggle
- type FeatureTogglesService
- func (p *FeatureTogglesService) AddStrategyToFeature(projectId string, featureName string, environment string, ...) (*FeatureStrategy, *Response, error)
- func (p *FeatureTogglesService) ArchiveFeature(projectId string, featureName string) (bool, *Response, error)
- func (p *FeatureTogglesService) CreateFeature(projectId string, feature FeatureToggle) (*FeatureToggle, *Response, error)
- func (p *FeatureTogglesService) DeleteArchivedFeature(featureName string) (bool, *Response, error)
- func (p *FeatureTogglesService) DeleteStrategyFromFeature(projectId string, featureName string, environment string, strategyId string) (bool, *Response, error)
- func (p *FeatureTogglesService) DeprecateStrategy(strategyName string) (bool, *Response, error)
- func (p *FeatureTogglesService) EnableFeatureOnEnvironment(projectId string, featureName string, environment string, enabled bool) (bool, *Response, error)
- func (p *FeatureTogglesService) GetFeatureByName(projectId string, featureName string) (*FeatureToggle, *Response, error)
- func (p *FeatureTogglesService) GetFeaturesByProject(projectId string) (*[]FeatureToggle, *Response, error)
- func (p *FeatureTogglesService) ReactivateStrategy(strategyName string) (bool, *Response, error)
- func (p *FeatureTogglesService) UpdateFeature(projectId string, feature FeatureToggle) (*FeatureToggle, *Response, error)
- func (p *FeatureTogglesService) UpdateFeatureStrategy(projectId string, featureName string, environment string, ...) (*FeatureStrategy, *Response, error)
- type FeatureType
- type FeatureTypesService
- type HTTPClient
- type ProjEnvironment
- type Project
- type ProjectDetails
- type ProjectsService
- func (p *ProjectsService) AddUserProject(userId int, projectId string, roleId int) (*AddUserRoleResponse, *Response, error)
- func (p *ProjectsService) CreateProject(project Project) (*CreateProjectResponse, *Response, error)
- func (p *ProjectsService) DeleteProject(projectId string) (*Response, error)
- func (p *ProjectsService) DeleteUserProject(projectId string, userId int, roleId int) (*AddUserRoleResponse, *Response, error)
- func (p *ProjectsService) GetProjectById(projectId string) (*ProjectDetails, *Response, error)
- func (p *ProjectsService) UpdateProject(projectId string, project Project) (*CreateProjectResponse, *Response, error)
- func (p *ProjectsService) UpdateUserProject(projectId string, userId int, roleId int) (*AddUserRoleResponse, *Response, error)
- type Response
- type StrategiesService
- func (p *StrategiesService) CreateStrategy(strategy Strategy) (*Strategy, *Response, error)
- func (p *StrategiesService) GetAllStrategies() (*AllStrategiesResponse, *Response, error)
- func (p *StrategiesService) GetStrategyByName(strategyName string) (*Strategy, *Response, error)
- func (p *StrategiesService) UpdateStrategy(strategy Strategy) (*Strategy, *Response, error)
- type Strategy
- type StrategyConstraint
- type StrategyParameter
- type UpdateFeatureTagsBody
- type User
- type UserDetails
- type UsersService
- func (p *UsersService) CreateUser(user User) (*UserDetails, *Response, error)
- func (p *UsersService) DeleteUser(userId string) (bool, *Response, error)
- func (p *UsersService) GetUserById(userId string) (*UserDetails, *Response, error)
- func (p *UsersService) SearchUser(query string) (*[]UserDetails, *Response, error)
- func (p *UsersService) UpdateUser(userId string, user User) (*UserDetails, *Response, error)
- type Variant
- type VariantOverride
- type VariantPayload
- type VariantsResponse
- type VariantsService
Constants ¶
View Source
const (
LibraryVersion = "0.0.1"
)
Variables ¶
View Source
var ( ErrNotFound = errors.New("entity not found") ErrApiUrlCannotBeEmpty = errors.New("api_url cannot be empty") ErrTokenAuthCannotBeEmpty = errors.New("auth_token cannot be empty") )
Exported Errors
Functions ¶
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present.
func ErrRequiredParam ¶ added in v0.1.1
Types ¶
type AddUserRoleResponse ¶ added in v1.0.3
type AllApiTokensResponse ¶ added in v1.0.2
type AllApiTokensResponse struct {
Tokens []ApiToken `json:"tokens"`
}
type AllFeatureTypesResponse ¶
type AllFeatureTypesResponse struct {
Version int `json:"version"`
Types []FeatureType `json:"types"`
}
type AllStrategiesResponse ¶
type ApiClient ¶
type ApiClient struct {
UserAgent string
FeatureTags *FeatureTagsService
FeatureToggles *FeatureTogglesService
Projects *ProjectsService
FeatureTypes *FeatureTypesService
Strategies *StrategiesService
Variants *VariantsService
Users *UsersService
ApiTokens *ApiTokenService
// contains filtered or unexported fields
}
type ApiToken ¶ added in v1.0.2
type ApiToken struct {
Secret string `json:"secret,omitempty"`
Username string `json:"username"`
Type string `json:"type"`
Environment string `json:"environment,omitempty"`
Projects []string `json:"projects,omitempty"`
ExpiresAt string `json:"expiresAt,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
}
type ApiTokenService ¶ added in v1.0.2
type ApiTokenService struct {
// contains filtered or unexported fields
}
func (*ApiTokenService) CreateApiToken ¶ added in v1.0.2
func (p *ApiTokenService) CreateApiToken(token ApiToken) (*ApiToken, *Response, error)
func (*ApiTokenService) DeleteApiToken ¶ added in v1.0.2
func (p *ApiTokenService) DeleteApiToken(secret string) (bool, *Response, error)
func (*ApiTokenService) GetAllApiTokens ¶ added in v1.0.2
func (p *ApiTokenService) GetAllApiTokens() (*AllApiTokensResponse, *Response, error)
func (*ApiTokenService) UpdateApiToken ¶ added in v1.0.2
type CreateProjectResponse ¶ added in v1.0.3
type Environment ¶
type Environment struct {
Enabled bool `json:"enabled"`
Name string `json:"name"`
Type string `json:"type"`
Strategies []FeatureStrategy `json:"strategies"`
}
type ErrorResponse ¶ added in v1.0.3
type FeatureStrategy ¶
type FeatureStrategy struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
Constraints []StrategyConstraint `json:"constraints,omitempty"`
Parameters interface{} `json:"parameters,omitempty"`
SortOrder int `json:"sortOrder"`
}
type FeatureTag ¶ added in v1.0.4
type FeatureTagsResponse ¶ added in v1.0.4
type FeatureTagsResponse struct {
Version int `json:"version"`
Tags []FeatureTag `json:"tags"`
}
type FeatureTagsService ¶ added in v1.0.4
type FeatureTagsService struct {
// contains filtered or unexported fields
}
func (*FeatureTagsService) CreateFeatureTags ¶ added in v1.0.4
func (p *FeatureTagsService) CreateFeatureTags(featureName string, tag FeatureTag) (*FeatureTag, *Response, error)
func (*FeatureTagsService) DeleteFeatureTags ¶ added in v1.0.4
func (p *FeatureTagsService) DeleteFeatureTags(featureName string, tag FeatureTag) (*Response, error)
func (*FeatureTagsService) GetAllFeatureTags ¶ added in v1.0.4
func (p *FeatureTagsService) GetAllFeatureTags(featureName string) (*FeatureTagsResponse, *Response, error)
func (*FeatureTagsService) UpdateFeatureTags ¶ added in v1.0.4
func (p *FeatureTagsService) UpdateFeatureTags(featureName string, addedTags []FeatureTag, removedTags []FeatureTag) (*FeatureTagsResponse, *Response, error)
type FeatureToggle ¶
type FeatureToggle struct {
Archived bool `json:"archived"`
CreatedAt string `json:"createdAt,omitempty"`
LastSeenAt string `json:"lastSeenAt,omitempty"`
Description string `json:"description"`
Name string `json:"name"`
Project string `json:"project"`
Stale bool `json:"stale"`
Type string `json:"type"`
Environments []Environment `json:"environments"`
Variants []Variant `json:"variants"`
}
type FeatureTogglesService ¶
type FeatureTogglesService struct {
// contains filtered or unexported fields
}
func (*FeatureTogglesService) AddStrategyToFeature ¶
func (p *FeatureTogglesService) AddStrategyToFeature(projectId string, featureName string, environment string, featureStrategy FeatureStrategy) (*FeatureStrategy, *Response, error)
Adds a strategy to a feature toggle in a given environment
func (*FeatureTogglesService) ArchiveFeature ¶
func (*FeatureTogglesService) CreateFeature ¶
func (p *FeatureTogglesService) CreateFeature(projectId string, feature FeatureToggle) (*FeatureToggle, *Response, error)
func (*FeatureTogglesService) DeleteArchivedFeature ¶ added in v0.1.0
func (p *FeatureTogglesService) DeleteArchivedFeature(featureName string) (bool, *Response, error)
func (*FeatureTogglesService) DeleteStrategyFromFeature ¶
func (p *FeatureTogglesService) DeleteStrategyFromFeature(projectId string, featureName string, environment string, strategyId string) (bool, *Response, error)
Deletes a strategy from a feature toggle in a given environment
func (*FeatureTogglesService) DeprecateStrategy ¶
func (p *FeatureTogglesService) DeprecateStrategy(strategyName string) (bool, *Response, error)
func (*FeatureTogglesService) EnableFeatureOnEnvironment ¶
func (*FeatureTogglesService) GetFeatureByName ¶
func (p *FeatureTogglesService) GetFeatureByName(projectId string, featureName string) (*FeatureToggle, *Response, error)
func (*FeatureTogglesService) GetFeaturesByProject ¶
func (p *FeatureTogglesService) GetFeaturesByProject(projectId string) (*[]FeatureToggle, *Response, error)
func (*FeatureTogglesService) ReactivateStrategy ¶
func (p *FeatureTogglesService) ReactivateStrategy(strategyName string) (bool, *Response, error)
func (*FeatureTogglesService) UpdateFeature ¶
func (p *FeatureTogglesService) UpdateFeature(projectId string, feature FeatureToggle) (*FeatureToggle, *Response, error)
func (*FeatureTogglesService) UpdateFeatureStrategy ¶
func (p *FeatureTogglesService) UpdateFeatureStrategy(projectId string, featureName string, environment string, featureStrategy FeatureStrategy) (*FeatureStrategy, *Response, error)
type FeatureType ¶
type FeatureTypesService ¶
type FeatureTypesService struct {
// contains filtered or unexported fields
}
func (*FeatureTypesService) GetAllFeatureTypes ¶
func (p *FeatureTypesService) GetAllFeatureTypes() (*AllFeatureTypesResponse, *Response, error)
type HTTPClient ¶
HTTPClient interface
type ProjEnvironment ¶ added in v1.0.6
type ProjEnvironment struct {
Environment string `json:"environment"`
}
type ProjectDetails ¶
type ProjectDetails struct {
Name string `json:"name"`
Description string `json:"description"`
Health int `json:"health"`
UpdatedAt string `json:"updatedAt"`
Environments []ProjEnvironment `json:"environments"`
}
type ProjectsService ¶
type ProjectsService struct {
// contains filtered or unexported fields
}
func (*ProjectsService) AddUserProject ¶ added in v1.0.3
func (p *ProjectsService) AddUserProject(userId int, projectId string, roleId int) (*AddUserRoleResponse, *Response, error)
func (*ProjectsService) CreateProject ¶ added in v1.0.3
func (p *ProjectsService) CreateProject(project Project) (*CreateProjectResponse, *Response, error)
func (*ProjectsService) DeleteProject ¶ added in v1.0.3
func (p *ProjectsService) DeleteProject(projectId string) (*Response, error)
func (*ProjectsService) DeleteUserProject ¶ added in v1.0.3
func (p *ProjectsService) DeleteUserProject(projectId string, userId int, roleId int) (*AddUserRoleResponse, *Response, error)
func (*ProjectsService) GetProjectById ¶
func (p *ProjectsService) GetProjectById(projectId string) (*ProjectDetails, *Response, error)
func (*ProjectsService) UpdateProject ¶ added in v1.0.3
func (p *ProjectsService) UpdateProject(projectId string, project Project) (*CreateProjectResponse, *Response, error)
func (*ProjectsService) UpdateUserProject ¶ added in v1.0.3
func (p *ProjectsService) UpdateUserProject(projectId string, userId int, roleId int) (*AddUserRoleResponse, *Response, error)
type StrategiesService ¶
type StrategiesService struct {
// contains filtered or unexported fields
}
func (*StrategiesService) CreateStrategy ¶
func (p *StrategiesService) CreateStrategy(strategy Strategy) (*Strategy, *Response, error)
func (*StrategiesService) GetAllStrategies ¶
func (p *StrategiesService) GetAllStrategies() (*AllStrategiesResponse, *Response, error)
func (*StrategiesService) GetStrategyByName ¶
func (p *StrategiesService) GetStrategyByName(strategyName string) (*Strategy, *Response, error)
func (*StrategiesService) UpdateStrategy ¶
func (p *StrategiesService) UpdateStrategy(strategy Strategy) (*Strategy, *Response, error)
type Strategy ¶
type Strategy struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
DisplayName string `json:"displayName,omitempty"`
Description string `json:"description"`
Editable bool `json:"editable"`
Deprecated bool `json:"deprecated"`
Parameters []StrategyParameter `json:"parameters"`
}
FeatureToggle represents a Feature Toggle resource
type StrategyConstraint ¶ added in v1.0.7
type StrategyParameter ¶
type UpdateFeatureTagsBody ¶ added in v1.0.4
type UpdateFeatureTagsBody struct {
AddedTags []FeatureTag `json:"addedTags"`
RemovedTags []FeatureTag `json:"removedTags"`
}
type UserDetails ¶ added in v0.1.1
type UserDetails struct {
Id int `json:"id"`
Name string `json:"name,omitempty"`
Username string `json:"username,omitempty"`
Email string `json:"email,omitempty"`
ImageUrl string `json:"imageUrl,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
InviteLink string `json:"inviteLink,omitempty"`
EmailSent bool `json:"emailSent,omitempty"`
RootRole int `json:"rootRole,omitempty"`
}
type UsersService ¶ added in v0.1.1
type UsersService struct {
// contains filtered or unexported fields
}
func (*UsersService) CreateUser ¶ added in v0.1.1
func (p *UsersService) CreateUser(user User) (*UserDetails, *Response, error)
func (*UsersService) DeleteUser ¶ added in v0.1.1
func (p *UsersService) DeleteUser(userId string) (bool, *Response, error)
func (*UsersService) GetUserById ¶ added in v0.1.1
func (p *UsersService) GetUserById(userId string) (*UserDetails, *Response, error)
func (*UsersService) SearchUser ¶ added in v0.1.1
func (p *UsersService) SearchUser(query string) (*[]UserDetails, *Response, error)
func (*UsersService) UpdateUser ¶ added in v0.1.1
func (p *UsersService) UpdateUser(userId string, user User) (*UserDetails, *Response, error)
type Variant ¶ added in v0.0.3
type Variant struct {
Name string `json:"name"`
Stickiness string `json:"stickiness"`
Weight int `json:"weight"`
WeightType string `json:"weightType"`
Overrides []VariantOverride `json:"overrides,omitempty"`
Payload *VariantPayload `json:"payload,omitempty"`
}
type VariantOverride ¶ added in v0.0.3
type VariantPayload ¶ added in v0.0.3
type VariantsResponse ¶ added in v0.0.5
type VariantsService ¶ added in v0.0.5
type VariantsService struct {
// contains filtered or unexported fields
}
func (*VariantsService) AddVariantsForFeatureToggle ¶ added in v0.0.5
func (p *VariantsService) AddVariantsForFeatureToggle(projectId string, featureName string, variants []Variant) (*VariantsResponse, *Response, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.