kafka

package
v0.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PermissionTypeChoices

func PermissionTypeChoices() []string

Types

type AclOut

type AclOut struct {
	Id         *string        `json:"id,omitempty"` // ID
	Permission PermissionType `json:"permission"`   // Kafka permission
	Topic      string         `json:"topic"`        // Topic name pattern
	Username   string         `json:"username"`
}

type Handler

type Handler interface {
	// ServiceKafkaAclAdd add a Kafka ACL entry
	// POST /v1/project/{project}/service/{service_name}/acl
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaAclAdd
	ServiceKafkaAclAdd(ctx context.Context, project string, serviceName string, in *ServiceKafkaAclAddIn) ([]AclOut, error)

	// ServiceKafkaAclDelete delete a Kafka ACL entry
	// DELETE /v1/project/{project}/service/{service_name}/acl/{kafka_acl_id}
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaAclDelete
	ServiceKafkaAclDelete(ctx context.Context, project string, serviceName string, kafkaAclId string) ([]AclOut, error)

	// ServiceKafkaAclList list Kafka ACL entries
	// GET /v1/project/{project}/service/{service_name}/acl
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaAclList
	ServiceKafkaAclList(ctx context.Context, project string, serviceName string) ([]AclOut, error)

	// ServiceKafkaQuotaCreate create Kafka quota
	// POST /v1/project/{project}/service/{service_name}/quota
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaQuotaCreate
	ServiceKafkaQuotaCreate(ctx context.Context, project string, serviceName string, in *ServiceKafkaQuotaCreateIn) error

	// ServiceKafkaQuotaDelete delete Kafka quota
	// DELETE /v1/project/{project}/service/{service_name}/quota
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaQuotaDelete
	ServiceKafkaQuotaDelete(ctx context.Context, project string, serviceName string) error

	// ServiceKafkaQuotaDescribe describe Specific Kafka quotas
	// GET /v1/project/{project}/service/{service_name}/quota/describe
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaQuotaDescribe
	ServiceKafkaQuotaDescribe(ctx context.Context, project string, serviceName string) (*ServiceKafkaQuotaDescribeOut, error)

	// ServiceKafkaQuotaList list Kafka quotas
	// GET /v1/project/{project}/service/{service_name}/quota
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaQuotaList
	ServiceKafkaQuotaList(ctx context.Context, project string, serviceName string) ([]QuotaOut, error)

	// ServiceKafkaTieredStorageStorageUsageByTopic get the Kafka tiered storage object storage usage by topic
	// GET /v1/project/{project}/service/{service_name}/kafka/tiered-storage/storage-usage/by-topic
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTieredStorageStorageUsageByTopic
	ServiceKafkaTieredStorageStorageUsageByTopic(ctx context.Context, project string, serviceName string) (map[string]any, error)

	// ServiceKafkaTieredStorageStorageUsageTotal get the Kafka tiered storage total object storage usage
	// GET /v1/project/{project}/service/{service_name}/kafka/tiered-storage/storage-usage/total
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTieredStorageStorageUsageTotal
	ServiceKafkaTieredStorageStorageUsageTotal(ctx context.Context, project string, serviceName string) (int, error)

	// ServiceKafkaTieredStorageSummary get the Kafka tiered storage summary
	// GET /v1/project/{project}/service/{service_name}/kafka/tiered-storage/summary
	// https://api.aiven.io/doc/#tag/Service:_Kafka/operation/ServiceKafkaTieredStorageSummary
	ServiceKafkaTieredStorageSummary(ctx context.Context, project string, serviceName string) (*ServiceKafkaTieredStorageSummaryOut, error)
}

type HourlyOut

type HourlyOut struct {
	EstimatedCost   *string `json:"estimated_cost,omitempty"` // The estimated cost in USD of tiered storage for this hour
	HourStart       string  `json:"hour_start"`               // Timestamp in ISO 8601 format, always in UTC
	PeakStoredBytes int     `json:"peak_stored_bytes"`        // Peak bytes stored on object storage at this hour
}

type KafkaHandler

type KafkaHandler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(doer doer) KafkaHandler

func (*KafkaHandler) ServiceKafkaAclAdd

func (h *KafkaHandler) ServiceKafkaAclAdd(ctx context.Context, project string, serviceName string, in *ServiceKafkaAclAddIn) ([]AclOut, error)

func (*KafkaHandler) ServiceKafkaAclDelete

func (h *KafkaHandler) ServiceKafkaAclDelete(ctx context.Context, project string, serviceName string, kafkaAclId string) ([]AclOut, error)

func (*KafkaHandler) ServiceKafkaAclList

func (h *KafkaHandler) ServiceKafkaAclList(ctx context.Context, project string, serviceName string) ([]AclOut, error)

func (*KafkaHandler) ServiceKafkaQuotaCreate

func (h *KafkaHandler) ServiceKafkaQuotaCreate(ctx context.Context, project string, serviceName string, in *ServiceKafkaQuotaCreateIn) error

func (*KafkaHandler) ServiceKafkaQuotaDelete

func (h *KafkaHandler) ServiceKafkaQuotaDelete(ctx context.Context, project string, serviceName string) error

func (*KafkaHandler) ServiceKafkaQuotaDescribe

func (h *KafkaHandler) ServiceKafkaQuotaDescribe(ctx context.Context, project string, serviceName string) (*ServiceKafkaQuotaDescribeOut, error)

func (*KafkaHandler) ServiceKafkaQuotaList

func (h *KafkaHandler) ServiceKafkaQuotaList(ctx context.Context, project string, serviceName string) ([]QuotaOut, error)

func (*KafkaHandler) ServiceKafkaTieredStorageStorageUsageByTopic

func (h *KafkaHandler) ServiceKafkaTieredStorageStorageUsageByTopic(ctx context.Context, project string, serviceName string) (map[string]any, error)

func (*KafkaHandler) ServiceKafkaTieredStorageStorageUsageTotal

func (h *KafkaHandler) ServiceKafkaTieredStorageStorageUsageTotal(ctx context.Context, project string, serviceName string) (int, error)

func (*KafkaHandler) ServiceKafkaTieredStorageSummary

func (h *KafkaHandler) ServiceKafkaTieredStorageSummary(ctx context.Context, project string, serviceName string) (*ServiceKafkaTieredStorageSummaryOut, error)

type PermissionType

type PermissionType string
const (
	PermissionTypeAdmin     PermissionType = "admin"
	PermissionTypeRead      PermissionType = "read"
	PermissionTypeReadwrite PermissionType = "readwrite"
	PermissionTypeWrite     PermissionType = "write"
)

type QuotaOut

type QuotaOut struct {
	ClientId          *string `json:"client-id,omitempty"` // client-id
	ConsumerByteRate  float64 `json:"consumer_byte_rate"`  // consumer network throttle
	ProducerByteRate  float64 `json:"producer_byte_rate"`  // producer network throttle
	RequestPercentage float64 `json:"request_percentage"`  // cpu percentage throttle
	User              string  `json:"user"`                // user
}

type ServiceKafkaAclAddIn

type ServiceKafkaAclAddIn struct {
	Permission PermissionType `json:"permission"` // Kafka permission
	Topic      string         `json:"topic"`      // Topic name pattern
	Username   string         `json:"username"`
}

ServiceKafkaAclAddIn ServiceKafkaAclAddRequestBody

type ServiceKafkaQuotaCreateIn

type ServiceKafkaQuotaCreateIn struct {
	ClientId          *string  `json:"client-id,omitempty"`          // client-id
	ConsumerByteRate  *float64 `json:"consumer_byte_rate,omitempty"` // consumer network throttle
	ProducerByteRate  *float64 `json:"producer_byte_rate,omitempty"` // producer network throttle
	RequestPercentage *float64 `json:"request_percentage,omitempty"` // cpu percentage throttle
	User              *string  `json:"user,omitempty"`               // user
}

ServiceKafkaQuotaCreateIn ServiceKafkaQuotaCreateRequestBody

type ServiceKafkaQuotaDescribeOut

type ServiceKafkaQuotaDescribeOut struct {
	ClientId          *string `json:"client-id,omitempty"` // client-id
	ConsumerByteRate  float64 `json:"consumer_byte_rate"`  // consumer network throttle
	ProducerByteRate  float64 `json:"producer_byte_rate"`  // producer network throttle
	RequestPercentage float64 `json:"request_percentage"`  // cpu percentage throttle
	User              string  `json:"user"`                // user
}

ServiceKafkaQuotaDescribeOut kafka quota

type ServiceKafkaTieredStorageSummaryOut

type ServiceKafkaTieredStorageSummaryOut struct {
	CurrentCost         string                 `json:"current_cost"`              // The current cost in USD of tiered storage since the beginning of the billing period
	ForecastedCost      string                 `json:"forecasted_cost"`           // The forecasted cost in USD of tiered storage in the billing period
	ForecastedRate      *string                `json:"forecasted_rate,omitempty"` // The rate on GBs/hour used to calculate the forecasted cost
	StorageUsageHistory StorageUsageHistoryOut `json:"storage_usage_history"`     // History of usage and cumulative costs in the billing period
	TotalStorageUsage   int                    `json:"total_storage_usage"`       // Total storage usage by tiered storage, in bytes
}

ServiceKafkaTieredStorageSummaryOut ServiceKafkaTieredStorageSummaryResponse

type StorageUsageHistoryOut

type StorageUsageHistoryOut struct {
	Hourly []HourlyOut `json:"hourly"` // History by hour
}

StorageUsageHistoryOut History of usage and cumulative costs in the billing period

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL