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 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 ¶
Types ¶
type AddUserRoleResponse ¶
type AllApiTokensResponse ¶
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 ¶
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 ¶
type ApiTokenService struct {
// contains filtered or unexported fields
}
func (*ApiTokenService) CreateApiToken ¶
func (p *ApiTokenService) CreateApiToken(token ApiToken) (*ApiToken, *Response, error)
func (*ApiTokenService) DeleteApiToken ¶
func (p *ApiTokenService) DeleteApiToken(secret string) (bool, *Response, error)
func (*ApiTokenService) GetAllApiTokens ¶
func (p *ApiTokenService) GetAllApiTokens() (*AllApiTokensResponse, *Response, error)
func (*ApiTokenService) UpdateApiToken ¶
type CreateProjectResponse ¶
type Environment ¶
type Environment struct { Enabled bool `json:"enabled"` Name string `json:"name"` Type string `json:"type"` Strategies []FeatureStrategy `json:"strategies"` }
type ErrorResponse ¶
type FeatureStrategy ¶
type FeatureTag ¶
type FeatureTagsResponse ¶
type FeatureTagsResponse struct { Version int `json:"version"` Tags []FeatureTag `json:"tags"` }
type FeatureTagsService ¶
type FeatureTagsService struct {
// contains filtered or unexported fields
}
func (*FeatureTagsService) CreateFeatureTags ¶
func (p *FeatureTagsService) CreateFeatureTags(featureName string, tag FeatureTag) (*FeatureTag, *Response, error)
func (*FeatureTagsService) DeleteFeatureTags ¶
func (p *FeatureTagsService) DeleteFeatureTags(featureName string, tag FeatureTag) (*Response, error)
func (*FeatureTagsService) GetAllFeatureTags ¶
func (p *FeatureTagsService) GetAllFeatureTags(featureName string) (*FeatureTagsResponse, *Response, error)
func (*FeatureTagsService) UpdateFeatureTags ¶
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 ¶
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 ¶
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 ¶
func (p *ProjectsService) AddUserProject(userId int, projectId string, roleId int) (*AddUserRoleResponse, *Response, error)
func (*ProjectsService) CreateProject ¶
func (p *ProjectsService) CreateProject(project Project) (*CreateProjectResponse, *Response, error)
func (*ProjectsService) DeleteProject ¶
func (p *ProjectsService) DeleteProject(projectId string) (*Response, error)
func (*ProjectsService) DeleteUserProject ¶
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 ¶
func (p *ProjectsService) UpdateProject(projectId string, project Project) (*CreateProjectResponse, *Response, error)
func (*ProjectsService) UpdateUserProject ¶
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 StrategyParameter ¶
type UpdateFeatureTagsBody ¶
type UpdateFeatureTagsBody struct { AddedTags []FeatureTag `json:"addedTags"` RemovedTags []FeatureTag `json:"removedTags"` }
type UserDetails ¶
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 ¶
type UsersService struct {
// contains filtered or unexported fields
}
func (*UsersService) CreateUser ¶
func (p *UsersService) CreateUser(user User) (*UserDetails, *Response, error)
func (*UsersService) DeleteUser ¶
func (p *UsersService) DeleteUser(userId string) (bool, *Response, error)
func (*UsersService) GetUserById ¶
func (p *UsersService) GetUserById(userId string) (*UserDetails, *Response, error)
func (*UsersService) SearchUser ¶
func (p *UsersService) SearchUser(query string) (*[]UserDetails, *Response, error)
func (*UsersService) UpdateUser ¶
func (p *UsersService) UpdateUser(userId string, user User) (*UserDetails, *Response, error)
type Variant ¶
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 ¶
type VariantPayload ¶
type VariantsResponse ¶
type VariantsService ¶
type VariantsService struct {
// contains filtered or unexported fields
}
func (*VariantsService) AddVariantsForFeatureToggle ¶
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.