Documentation ¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type BasicAuth
- type ConfigCreate
- type ConfigUpdate
- type Configuration
- type DefaultApiService
- func (a *DefaultApiService) CreateTopic(ctx _context.Context, topicCreate TopicCreateRequest) (map[string]interface{}, *_nethttp.Response, error)
- func (a *DefaultApiService) DeleteTopic(ctx _context.Context, topicName string) (map[string]interface{}, *_nethttp.Response, error)
- func (a *DefaultApiService) GetTopic(ctx _context.Context, topicName string) (TopicDetail, *_nethttp.Response, error)
- func (a *DefaultApiService) ListTopics(ctx _context.Context, localVarOptionals *ListTopicsOpts) ([]TopicDetail, *_nethttp.Response, error)
- func (a *DefaultApiService) UpdateTopic(ctx _context.Context, topicName string, topicUpdate TopicUpdateRequest) (map[string]interface{}, *_nethttp.Response, error)
- type GenericOpenAPIError
- type ListTopicsOpts
- type ModelError
- type ReplicaAssignment
- type ReplicaAssignmentBrokers
- type ServerConfiguration
- type ServerVariable
- type TopicConfigs
- type TopicCreateRequest
- type TopicDetail
- type TopicUpdateRequest
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes an 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 { DefaultApi *DefaultApiService // contains filtered or unexported fields }
APIClient manages communication with the IBM Event Streams Administration REST API API v1.1.0 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 ¶
ChangeBasePath changes base path to allow switching to mocks
func (*APIClient) GetConfig ¶
func (c *APIClient) GetConfig() *Configuration
Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
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 OpenAPI 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:"-"` }
APIResponse stores the API response returned by the server.
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
NewAPIResponse returns a new APIResonse object.
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
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 ConfigCreate ¶
type ConfigCreate struct { // The name of the config property. Name string `json:"name,omitempty"` // The value for a config property. Value string `json:"value,omitempty"` }
ConfigCreate struct for ConfigCreate
type ConfigUpdate ¶
type ConfigUpdate struct { // The name of the config property. Name string `json:"name,omitempty"` // The value for a config property. Value string `json:"value,omitempty"` // When true, the value of the config property is reset to its default value. ResetToDefault bool `json:"reset_to_default,omitempty"` }
ConfigUpdate struct for ConfigUpdate
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"` Debug bool `json:"debug,omitempty"` Servers []ServerConfiguration HTTPClient *http.Client }
Configuration stores the configuration of the API client
func NewConfiguration ¶
func NewConfiguration() *Configuration
NewConfiguration returns a new Configuration object
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
AddDefaultHeader adds a new HTTP header to the default header in the request
type DefaultApiService ¶
type DefaultApiService service
DefaultApiService DefaultApi service
func (*DefaultApiService) CreateTopic ¶
func (a *DefaultApiService) CreateTopic(ctx _context.Context, topicCreate TopicCreateRequest) (map[string]interface{}, *_nethttp.Response, error)
CreateTopic Create a new topic. Create a new topic.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param topicCreate The new topic to be created.
@return map[string]interface{}
func (*DefaultApiService) DeleteTopic ¶
func (a *DefaultApiService) DeleteTopic(ctx _context.Context, topicName string) (map[string]interface{}, *_nethttp.Response, error)
DeleteTopic Delete a topic. Delete a topic.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param topicName The topic name for the topic to be listed.
@return map[string]interface{}
func (*DefaultApiService) GetTopic ¶
func (a *DefaultApiService) GetTopic(ctx _context.Context, topicName string) (TopicDetail, *_nethttp.Response, error)
GetTopic Get detailed information on a topic. Get detailed information on a topic.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param topicName The topic name for the topic to be listed.
@return TopicDetail
func (*DefaultApiService) ListTopics ¶
func (a *DefaultApiService) ListTopics(ctx _context.Context, localVarOptionals *ListTopicsOpts) ([]TopicDetail, *_nethttp.Response, error)
ListTopics Get a list of topics. Returns a list containing information about all of the Kafka topics that are defined for an instance of the Event Streams service. If there are currently no topics defined then an empty list is returned.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param optional nil or *ListTopicsOpts - Optional Parameters:
- @param "TopicFilter" (optional.String) - A filter to be applied to the topic names. A simple filter can be specified as a string with asterisk (`*`) wildcards representing 0 or more characters, e.g. `topic-name*` will filter all topic names that begin with the string `topic-name` followed by any character sequence. A more complex filter pattern can be used by surrounding a regular expression in forward slash (`/`) delimiters, e.g. `/topic-name.* /`.
- @param "PerPage" (optional.Int32) - The number of topic names to be returns.
- @param "Page" (optional.Int32) - The page number to be returned. The number 1 represents the first page. The default value is 1.
@return []TopicDetail
func (*DefaultApiService) UpdateTopic ¶
func (a *DefaultApiService) UpdateTopic(ctx _context.Context, topicName string, topicUpdate TopicUpdateRequest) (map[string]interface{}, *_nethttp.Response, error)
UpdateTopic Increase the number of partitions and/or update one or more topic configuration parameters. Increase the number of partitions and/or update one or more topic configuration parameters.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param topicName The topic name for the topic to be listed.
- @param topicUpdate The new partition number or the configurations to be updated for the topic.
@return map[string]interface{}
type GenericOpenAPIError ¶
type GenericOpenAPIError struct {
// contains filtered or unexported fields
}
GenericOpenAPIError Provides access to the body, error and model on returned errors.
func (GenericOpenAPIError) Body ¶
func (e GenericOpenAPIError) Body() []byte
Body returns the raw bytes of the response
func (GenericOpenAPIError) Error ¶
func (e GenericOpenAPIError) Error() string
Error returns non-empty string if there was an error.
func (GenericOpenAPIError) Model ¶
func (e GenericOpenAPIError) Model() interface{}
Model returns the unpacked model of the error
type ListTopicsOpts ¶
type ListTopicsOpts struct { TopicFilter optional.String PerPage optional.Int32 Page optional.Int32 }
ListTopicsOpts Optional parameters for the method 'ListTopics'
type ModelError ¶
type ModelError struct { // The 3-digits http status code plus 2-digits kafka error code. ErrorCode int32 `json:"error_code,omitempty"` // The error message. Message string `json:"message,omitempty"` // The incident ID of the error. IncidentId string `json:"incident_id,omitempty"` }
ModelError struct for ModelError
type ReplicaAssignment ¶
type ReplicaAssignment struct { // The ID of the partition. Id int32 `json:"id,omitempty"` Brokers ReplicaAssignmentBrokers `json:"brokers,omitempty"` }
ReplicaAssignment struct for ReplicaAssignment
type ReplicaAssignmentBrokers ¶
type ReplicaAssignmentBrokers struct {
Replicas []int32 `json:"replicas,omitempty"`
}
ReplicaAssignmentBrokers struct for ReplicaAssignmentBrokers
type ServerConfiguration ¶
type ServerConfiguration struct { Url string Description string Variables map[string]ServerVariable }
ServerConfiguration stores the information about a server
type ServerVariable ¶
ServerVariable stores the information about a server variable
type TopicConfigs ¶
type TopicConfigs struct { // The value of config property 'cleanup.policy'. CleanupPolicy string `json:"cleanup.policy,omitempty"` // The value of config property 'min.insync.replicas' MinInsyncReplicas string `json:"min.insync.replicas,omitempty"` // The value of config property 'retention.bytes'. RetentionBytes string `json:"retention.bytes,omitempty"` // The value of config property 'retention.ms' RetentionMs string `json:"retention.ms,omitempty"` // The value of config property 'segment.bytes'. SegmentBytes string `json:"segment.bytes,omitempty"` // The value of config property 'segment.index.bytes'. SegmentIndexBytes string `json:"segment.index.bytes,omitempty"` // The value of config property 'segment.ms'. SegmentMs string `json:"segment.ms,omitempty"` }
TopicConfigs struct for TopicConfigs
type TopicCreateRequest ¶
type TopicCreateRequest struct { // The name of topic to be created. Name string `json:"name,omitempty"` // The number of partitions. Partitions int64 `json:"partitions,omitempty"` // The number of partitions, this field takes precedence over 'partitions'. Default value is 1 if not specified. PartitionCount int64 `json:"partition_count,omitempty"` // The config properties to be set for the new topic. Configs []ConfigCreate `json:"configs,omitempty"` }
TopicCreateRequest struct for TopicCreateRequest
type TopicDetail ¶
type TopicDetail struct { // The name of the topic. Name string `json:"name,omitempty"` // The number of partitions. Partitions int32 `json:"partitions,omitempty"` // The number of replication factor. ReplicationFactor int32 `json:"replicationFactor,omitempty"` // The value of config property 'retention.ms'. RetentionMs int32 `json:"retentionMs,omitempty"` // The value of config property 'cleanup.policy'. CleanupPolicy string `json:"cleanupPolicy,omitempty"` Configs TopicConfigs `json:"configs,omitempty"` // The replia assignment of the topic. ReplicaAssignments []ReplicaAssignment `json:"replicaAssignments,omitempty"` }
TopicDetail struct for TopicDetail
type TopicUpdateRequest ¶
type TopicUpdateRequest struct { // The new partition number to be increased. NewTotalPartitionCount int32 `json:"new_total_partition_count,omitempty"` // The config properties to be updated for the topic. Valid config keys are 'cleanup.policy', 'retention.ms', 'retention.bytes', 'segment.bytes', 'segment.ms', 'segment.index.bytes'. Configs []ConfigUpdate `json:"configs,omitempty"` }
TopicUpdateRequest struct for TopicUpdateRequest