Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a RocketFlag API client.
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
NewClient creates a new Client with optional configurations.
func (*Client) GetFlag ¶
func (c *Client) GetFlag(flagID string, userContext UserContext) (*FlagStatus, error)
GetFlag retrieves a feature flag from the RocketFlag API.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption defines a function type that modifies the Client.
func WithAPIURL ¶
func WithAPIURL(apiUrl string) ClientOption
WithAPIURL sets the API URL for the Client.
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ClientOption
WithHTTPClient sets a custom HTTP client for the Client.
func WithVersion ¶
func WithVersion(version string) ClientOption
WithVersion sets the version for the Client.
type FlagStatus ¶
type FlagStatus struct { Name string `json:"name"` Enabled bool `json:"enabled"` ID string `json:"id"` }
FlagStatus represents the status of a feature flag.
type UserContext ¶
type UserContext map[string]interface{}
UserContext allows for passing user-specific context to the API, such as a cohort.
Click to show internal directories.
Click to hide internal directories.