Documentation
¶
Index ¶
- Constants
- func MarshalRequest(v interface{}) (*http.Request, error)
- type AccessTokenAuth
- type AuthInfo
- type AuthType
- type BasicAuth
- type Client
- func (c *Client) AddBroker(r *api.AddBrokerRequest) (*api.AddBrokerResponse, error)
- func (c *Client) Admin(r *api.AdminRequest) (*api.AdminResponse, error)
- func (c *Client) Bootstrap(r *api.BootstrapRequest) (*api.BootstrapResponse, error)
- func (c *Client) Context() context.Context
- func (c *Client) DemoteBroker(r *api.DemoteBrokerRequest) (*api.DemoteBrokerResponse, error)
- func (c *Client) FixOfflineReplicas(r *api.FixOfflineReplicasRequest) (*api.FixOfflineReplicasResponse, error)
- func (c *Client) KafkaClusterLoad(r *api.KafkaClusterLoadRequest) (*api.KafkaClusterLoadResponse, error)
- func (c *Client) KafkaClusterState(r *api.KafkaClusterStateRequest) (*api.KafkaClusterStateResponse, error)
- func (c *Client) KafkaPartitionLoad(r *api.KafkaPartitionLoadRequest) (*api.KafkaPartitionLoadResponse, error)
- func (c *Client) PauseSampling(r *api.PauseSamplingRequest) (*api.PauseSamplingResponse, error)
- func (c *Client) Proposals(r *api.ProposalsRequest) (*api.ProposalsResponse, error)
- func (c *Client) Rebalance(r *api.RebalanceRequest) (*api.RebalanceResponse, error)
- func (c *Client) RemoveBroker(r *api.RemoveBrokerRequest) (*api.RemoveBrokerResponse, error)
- func (c *Client) ResumeSampling(r *api.ResumeSamplingRequest) (*api.ResumeSamplingResponse, error)
- func (c *Client) Review(r *api.ReviewRequest) (*api.ReviewResponse, error)
- func (c *Client) ReviewBoard(r *api.ReviewBoardRequest) (*api.ReviewBoardResponse, error)
- func (c *Client) Rightsize(r *api.RightsizeRequest) (*api.RightsizeResponse, error)
- func (c *Client) State(r *api.StateRequest) (*api.StateResponse, error)
- func (c *Client) StopProposalExecution(r *api.StopProposalExecutionRequest) (*api.StopProposalExecutionResponse, error)
- func (c Client) String() string
- func (c *Client) TopicConfiguration(r *api.TopicConfigurationRequest) (*api.TopicConfigurationResponse, error)
- func (c *Client) Train(r *api.TrainRequest) (*api.TrainResponse, error)
- func (c *Client) UserTasks(r *api.UserTasksRequest) (*api.UserTasksResponse, error)
- type Config
- type ContentType
- type RequestMarshaler
- type RequestOptions
- func WithAcceptJSON() RequestOptions
- func WithAuthInfo(a AuthInfo) RequestOptions
- func WithContentTypeJSON() RequestOptions
- func WithContext(ctx context.Context) RequestOptions
- func WithEndpoint(endpoint types.APIEndpoint) RequestOptions
- func WithHeader(h string, v string) RequestOptions
- func WithJSONQuery() RequestOptions
- func WithMethod(m string) RequestOptions
- func WithServerURL(u *url.URL) RequestOptions
- func WithUserAgent(agent string) RequestOptions
Constants ¶
const ( DefaultServerURL = "http://localhost:8090/kafkacruisecontrol" DefaultUserAgent = "go-cruise-control" DefaultRequestTimeout = 30 * time.Second )
const ( ServerURLEnvKey = prefix + "SERVER_URL" AuthTypeEnvKey = prefix + "AUTH_TYPE" UsernameEnvKey = prefix + "USERNAME" PasswordEnvKey = prefix + "PASSWORD" AccessTokenEnvKey = prefix + "ACCESS_TOKEN" UserAgentEnvKey = prefix + "USER_AGENT" )
const ( HTTPHeaderUserAgent = "User-Agent" HTTPHeaderAccept = "Accept" HTTPHeaderContentType = "Content-Type" MIMETypeJSON = "application/json" ChartSetUTF8 = "utf-8" )
const (
HTTPHeaderAuthorization = "Authorization"
)
Variables ¶
This section is empty.
Functions ¶
func MarshalRequest ¶
Types ¶
type AccessTokenAuth ¶
type AccessTokenAuth struct {
// contains filtered or unexported fields
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient returns a new API client with the provided configuration. It returns an error if the configuration is invalid.
func NewDefaultClient ¶
NewDefaultClient return a new API client with default configuration. It returns an error if the configuration is invalid.
func (*Client) AddBroker ¶
func (c *Client) AddBroker(r *api.AddBrokerRequest) (*api.AddBrokerResponse, error)
func (*Client) Admin ¶
func (c *Client) Admin(r *api.AdminRequest) (*api.AdminResponse, error)
func (*Client) Bootstrap ¶
func (c *Client) Bootstrap(r *api.BootstrapRequest) (*api.BootstrapResponse, error)
func (*Client) DemoteBroker ¶
func (c *Client) DemoteBroker(r *api.DemoteBrokerRequest) (*api.DemoteBrokerResponse, error)
func (*Client) FixOfflineReplicas ¶
func (c *Client) FixOfflineReplicas(r *api.FixOfflineReplicasRequest) (*api.FixOfflineReplicasResponse, error)
func (*Client) KafkaClusterLoad ¶
func (c *Client) KafkaClusterLoad(r *api.KafkaClusterLoadRequest) (*api.KafkaClusterLoadResponse, error)
func (*Client) KafkaClusterState ¶
func (c *Client) KafkaClusterState(r *api.KafkaClusterStateRequest) (*api.KafkaClusterStateResponse, error)
func (*Client) KafkaPartitionLoad ¶
func (c *Client) KafkaPartitionLoad(r *api.KafkaPartitionLoadRequest) (*api.KafkaPartitionLoadResponse, error)
func (*Client) PauseSampling ¶
func (c *Client) PauseSampling(r *api.PauseSamplingRequest) (*api.PauseSamplingResponse, error)
func (*Client) Proposals ¶
func (c *Client) Proposals(r *api.ProposalsRequest) (*api.ProposalsResponse, error)
func (*Client) Rebalance ¶
func (c *Client) Rebalance(r *api.RebalanceRequest) (*api.RebalanceResponse, error)
func (*Client) RemoveBroker ¶
func (c *Client) RemoveBroker(r *api.RemoveBrokerRequest) (*api.RemoveBrokerResponse, error)
func (*Client) ResumeSampling ¶
func (c *Client) ResumeSampling(r *api.ResumeSamplingRequest) (*api.ResumeSamplingResponse, error)
func (*Client) Review ¶
func (c *Client) Review(r *api.ReviewRequest) (*api.ReviewResponse, error)
func (*Client) ReviewBoard ¶
func (c *Client) ReviewBoard(r *api.ReviewBoardRequest) (*api.ReviewBoardResponse, error)
ReviewBoard returns a list of Cruise Control requests with their review state.
func (*Client) Rightsize ¶
func (c *Client) Rightsize(r *api.RightsizeRequest) (*api.RightsizeResponse, error)
Rightsize allows manually invoke provisioner rightsizing of the cluster.
func (*Client) State ¶
func (c *Client) State(r *api.StateRequest) (*api.StateResponse, error)
State reports back the Cruise Control state.
func (*Client) StopProposalExecution ¶
func (c *Client) StopProposalExecution(r *api.StopProposalExecutionRequest) (*api.StopProposalExecutionResponse, error)
StopProposalExecution invoke stopping of ongoing proposal execution in Cruise Control.
func (*Client) TopicConfiguration ¶
func (c *Client) TopicConfiguration(r *api.TopicConfigurationRequest) (*api.TopicConfigurationResponse, error)
TopicConfiguration allows changing Kafka topic configuration using Cruise Control.
func (*Client) Train ¶
func (c *Client) Train(r *api.TrainRequest) (*api.TrainResponse, error)
Train Cruise Control to better model broker cpu usage.
func (*Client) UserTasks ¶
func (c *Client) UserTasks(r *api.UserTasksRequest) (*api.UserTasksResponse, error)
UserTasks returns the list of recent tasks performed by Cruise Control.
type Config ¶
type Config struct { ServerURL string AuthType AuthType Username string Password string AccessToken string UserAgent string }
Config contains the configuration parameters for the API Client
func (*Config) ReadFromEnvironment ¶
func (c *Config) ReadFromEnvironment()
type ContentType ¶
type RequestMarshaler ¶
RequestMarshaler is the interface implemented by types that can marshal themselves into valid http.Request
type RequestOptions ¶
type RequestOptions interface {
// contains filtered or unexported methods
}
func WithAcceptJSON ¶
func WithAcceptJSON() RequestOptions
func WithAuthInfo ¶
func WithAuthInfo(a AuthInfo) RequestOptions
func WithContentTypeJSON ¶
func WithContentTypeJSON() RequestOptions
func WithContext ¶
func WithContext(ctx context.Context) RequestOptions
func WithEndpoint ¶
func WithEndpoint(endpoint types.APIEndpoint) RequestOptions
func WithHeader ¶
func WithHeader(h string, v string) RequestOptions
func WithJSONQuery ¶
func WithJSONQuery() RequestOptions
func WithMethod ¶
func WithMethod(m string) RequestOptions
func WithServerURL ¶
func WithServerURL(u *url.URL) RequestOptions
func WithUserAgent ¶
func WithUserAgent(agent string) RequestOptions