admin

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

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
	//TODO
	//TopicList(ctx context.Context, mq *primitive.MessageQueue) (*remote.RemotingCommand, 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

func WithCredentials(c primitive.Credentials) AdminOption

func WithNamespace

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 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 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
}

Jump to

Keyboard shortcuts

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