admin

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdmin

func NewAdmin(opts ...AdminOption) (*admin, error)

NewAdmin initialize admin

Types

type Admin

type Admin interface {
	CreateTopic(ctx context.Context, opts ...OptionCreate) error
	DeleteTopic(ctx context.Context, opts ...OptionDelete) error

	GetAllSubscriptionGroup(ctx context.Context, brokerAddr string, timeoutMillis time.Duration) (*SubscriptionGroupWrapper, error)
	FetchAllTopicList(ctx context.Context) (*TopicList, error)
	//GetBrokerClusterInfo(ctx context.Context) (*remote.RemotingCommand, error)
	FetchPublishMessageQueues(ctx context.Context, topic string) ([]*primitive.MessageQueue, error)
	Close() error
}

type AdminOption

type AdminOption func(options *adminOptions)

func WithCredentials added in v2.1.2

func WithCredentials(c primitive.Credentials) AdminOption

func WithNamespace added in v2.1.2

func WithNamespace(namespace string) AdminOption

WithNamespace set the namespace of admin

func WithResolver

func WithResolver(resolver primitive.NsResolver) AdminOption

WithResolver nameserver resolver to fetch nameserver addr

type DataVersion added in v2.1.2

type DataVersion struct {
	Timestamp int64
	Counter   int32
}

type OptionCreate

type OptionCreate func(*TopicConfigCreate)

func WithBrokerAddrCreate

func WithBrokerAddrCreate(BrokerAddr string) OptionCreate

func WithOrder

func WithOrder(Order bool) OptionCreate

func WithPerm

func WithPerm(Perm int) OptionCreate

func WithReadQueueNums

func WithReadQueueNums(ReadQueueNums int) OptionCreate

func WithTopicCreate

func WithTopicCreate(Topic string) OptionCreate

func WithTopicFilterType

func WithTopicFilterType(TopicFilterType string) OptionCreate

func WithTopicSysFlag

func WithTopicSysFlag(TopicSysFlag int) OptionCreate

func WithWriteQueueNums

func WithWriteQueueNums(WriteQueueNums int) OptionCreate

type OptionDelete

type OptionDelete func(*TopicConfigDelete)

func WithBrokerAddrDelete

func WithBrokerAddrDelete(BrokerAddr string) OptionDelete

func WithClusterName

func WithClusterName(ClusterName string) OptionDelete

func WithNameSrvAddr

func WithNameSrvAddr(NameSrvAddr []string) OptionDelete

func WithTopicDelete

func WithTopicDelete(Topic string) OptionDelete

type RemotingSerializable added in v2.1.2

type RemotingSerializable struct {
}

func (*RemotingSerializable) Decode added in v2.1.2

func (r *RemotingSerializable) Decode(data []byte, classOfT interface{}) (interface{}, error)

func (*RemotingSerializable) Encode added in v2.1.2

func (r *RemotingSerializable) Encode(obj interface{}) ([]byte, error)

func (*RemotingSerializable) FromJson added in v2.1.2

func (r *RemotingSerializable) FromJson(jsonStr string, classOfT interface{}) (interface{}, error)

func (*RemotingSerializable) ToJson added in v2.1.2

func (r *RemotingSerializable) ToJson(obj interface{}, prettyFormat bool) string

type SubscriptionGroupConfig added in v2.1.2

type SubscriptionGroupConfig struct {
	GroupName                      string
	ConsumeEnable                  bool
	ConsumeFromMinEnable           bool
	ConsumeBroadcastEnable         bool
	RetryMaxTimes                  int
	RetryQueueNums                 int
	BrokerId                       int
	WhichBrokerWhenConsumeSlowly   int
	NotifyConsumerIdsChangedEnable bool
}

type SubscriptionGroupWrapper added in v2.1.2

type SubscriptionGroupWrapper struct {
	SubscriptionGroupTable map[string]SubscriptionGroupConfig
	DataVersion            DataVersion
	RemotingSerializable
}

type TopicConfigCreate

type TopicConfigCreate struct {
	Topic           string
	BrokerAddr      string
	DefaultTopic    string
	ReadQueueNums   int
	WriteQueueNums  int
	Perm            int
	TopicFilterType string
	TopicSysFlag    int
	Order           bool
}

type TopicConfigDelete

type TopicConfigDelete struct {
	Topic       string
	ClusterName string
	NameSrvAddr []string
	BrokerAddr  string
}

type TopicList added in v2.1.2

type TopicList struct {
	TopicList  []string
	BrokerAddr string
	RemotingSerializable
}

Jump to

Keyboard shortcuts

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