Documentation
¶
Index ¶
- Variables
- func Brokers() ([]int, error)
- func Connect(urls []string) error
- func CreateAcl(req AclRequest) error
- func CreateUser(name, password string) error
- func DeleteAcl(req AclRequest) error
- func DeleteUser(name string) error
- func Exists(path string) bool
- func Get(path string, v interface{}) error
- func Metrics(uri string) map[string]int
- func Stats(uri string) map[string]interface{}
- func Stop()
- func TopicConfig(name string) ([]byte, error)
- func Topics(p Permissions) ([]string, error)
- func User(name string) ([]byte, error)
- func Users(username string, p Permissions) (users, error)
- func ValidateScramLogin(user, pass string) bool
- func WatchBrokers(ch chan []HostPort)
- func WatchChildren(path string) ([]string, *zk.Stat, <-chan zk.Event, error)
- func WatchTopics(ch chan []T)
- type ACLResource
- type ACLRule
- type ACLRules
- type AclPatternType
- type AclRequest
- type AclResourceType
- type AllFunc
- type B
- type C
- type HostPort
- type Permission
- func (p Permission) All() bool
- func (p Permission) Allow() bool
- func (p Permission) Alter(resource string) bool
- func (p Permission) AlterConfigs(resource string) bool
- func (p Permission) CheckResource(resource string) bool
- func (p Permission) Create(resource string) bool
- func (p Permission) Delete(resource string) bool
- func (p Permission) Deny() bool
- func (p Permission) Describe(resource string) bool
- func (p Permission) DescribeConfigs(resource string) bool
- func (p Permission) IdempotentWrite(resource string) bool
- func (p Permission) Read(resource string) bool
- func (p Permission) Write(resource string) bool
- type PermissionFunc
- type Permissions
- func (p Permissions) AlterConfigsCluster() bool
- func (p Permissions) CreateAcl() bool
- func (p Permissions) CreateTopic(resource string) bool
- func (p Permissions) CreateUser() bool
- func (p Permissions) DeleteAcl() bool
- func (p Permissions) DeleteTopic(resource string) bool
- func (p Permissions) DeleteUser() bool
- func (p Permissions) DescribeAcls() bool
- func (p Permissions) DescribeConfigs() bool
- func (p Permissions) DescribeGroup(resource string) bool
- func (p Permissions) DescribeTopic(resource string) bool
- func (p Permissions) ListAcls() bool
- func (p Permissions) ListBrokers() bool
- func (p Permissions) ListGroups() bool
- func (p Permissions) ListUsers() bool
- func (p Permissions) ReadCluster(resource string) bool
- func (p Permissions) ReadGroup(resource string) bool
- func (p Permissions) ReadTopic(resource string) bool
- func (p Permissions) UpdateTopic(resource string) bool
- func (p Permissions) WriteCluster(resource string) bool
- type T
- type UserACL
Constants ¶
This section is empty.
Variables ¶
View Source
var AdminPermissions = Permissions{ Cluster: AllowAll, Topic: AllowAll, Group: AllowAll, }
View Source
var AllowAll = []Permission{{"All", "Allow", "LITERAL", "*"}}
View Source
var (
PathDoesNotExistsErr = errors.New("Zookeeper: Path does not exists")
)
Functions ¶
func CreateAcl ¶
func CreateAcl(req AclRequest) error
func CreateUser ¶
func DeleteAcl ¶
func DeleteAcl(req AclRequest) error
func DeleteUser ¶
func TopicConfig ¶
func Topics ¶
func Topics(p Permissions) ([]string, error)
func Users ¶
func Users(username string, p Permissions) (users, error)
func ValidateScramLogin ¶
func WatchBrokers ¶
func WatchBrokers(ch chan []HostPort)
func WatchTopics ¶
func WatchTopics(ch chan []T)
Types ¶
type ACLResource ¶
type ACLRule ¶
type ACLRule struct { Resource ACLResource `json:"resource"` Users []UserACL `json:"users"` }
func (ACLRule) MarshalJSON ¶
type ACLRules ¶
type ACLRules []ACLRule
func Acls ¶
func Acls(p Permissions) (ACLRules, error)
func ClusterAcls ¶
func ClusterAcls(p Permissions) (ACLRules, error)
func GroupAcls ¶
func GroupAcls(p Permissions) (ACLRules, error)
func TopicAcls ¶
func TopicAcls(p Permissions) (ACLRules, error)
type AclPatternType ¶
type AclPatternType int
const ( LiteralPattern AclPatternType = 0 PrefixedPattern AclPatternType = 1 )
func AclPatternTypeFromString ¶
func AclPatternTypeFromString(v string) (AclPatternType, error)
type AclRequest ¶
type AclRequest struct { PatternType AclPatternType ResourceType AclResourceType Name string Principal string Permission string PermissionType string Host string }
func (AclRequest) Data ¶
func (me AclRequest) Data() map[string]string
func (AclRequest) Path ¶
func (me AclRequest) Path() string
type AclResourceType ¶
type AclResourceType int
const ( ClusterResource AclResourceType = 0 TopicResource AclResourceType = 1 GroupResource AclResourceType = 2 )
func AclResourceFromString ¶
func AclResourceFromString(v string) (AclResourceType, error)
func (AclResourceType) String ¶
func (me AclResourceType) String() string
type AllFunc ¶
type AllFunc func(Permissions) ([]string, error)
type B ¶
type C ¶
type C struct { Timestamp string `json:"timestamp"` BrokerId int `json:"brokerid"` Version int `json:"version"` }
Controller struct from Zookeeper Path "/controller"
func Controller ¶
type Permission ¶
func (Permission) All ¶
func (p Permission) All() bool
func (Permission) Allow ¶
func (p Permission) Allow() bool
func (Permission) Alter ¶
func (p Permission) Alter(resource string) bool
func (Permission) AlterConfigs ¶
func (p Permission) AlterConfigs(resource string) bool
func (Permission) CheckResource ¶
func (p Permission) CheckResource(resource string) bool
Check if rule matches resource on name
func (Permission) Create ¶
func (p Permission) Create(resource string) bool
func (Permission) Delete ¶
func (p Permission) Delete(resource string) bool
func (Permission) Deny ¶
func (p Permission) Deny() bool
func (Permission) Describe ¶
func (p Permission) Describe(resource string) bool
func (Permission) DescribeConfigs ¶
func (p Permission) DescribeConfigs(resource string) bool
func (Permission) IdempotentWrite ¶
func (p Permission) IdempotentWrite(resource string) bool
func (Permission) Read ¶
func (p Permission) Read(resource string) bool
func (Permission) Write ¶
func (p Permission) Write(resource string) bool
type PermissionFunc ¶
type Permissions ¶
type Permissions struct { Cluster []Permission Topic []Permission Group []Permission }
func PermissionsFor ¶
func PermissionsFor(username string) (Permissions, error)
func (Permissions) AlterConfigsCluster ¶
func (p Permissions) AlterConfigsCluster() bool
func (Permissions) CreateAcl ¶
func (p Permissions) CreateAcl() bool
func (Permissions) CreateTopic ¶
func (p Permissions) CreateTopic(resource string) bool
func (Permissions) CreateUser ¶
func (p Permissions) CreateUser() bool
func (Permissions) DeleteAcl ¶
func (p Permissions) DeleteAcl() bool
func (Permissions) DeleteTopic ¶
func (p Permissions) DeleteTopic(resource string) bool
func (Permissions) DeleteUser ¶
func (p Permissions) DeleteUser() bool
func (Permissions) DescribeAcls ¶
func (p Permissions) DescribeAcls() bool
func (Permissions) DescribeConfigs ¶
func (p Permissions) DescribeConfigs() bool
func (Permissions) DescribeGroup ¶
func (p Permissions) DescribeGroup(resource string) bool
func (Permissions) DescribeTopic ¶
func (p Permissions) DescribeTopic(resource string) bool
func (Permissions) ListAcls ¶
func (p Permissions) ListAcls() bool
func (Permissions) ListBrokers ¶
func (p Permissions) ListBrokers() bool
func (Permissions) ListGroups ¶
func (p Permissions) ListGroups() bool
func (Permissions) ListUsers ¶
func (p Permissions) ListUsers() bool
func (Permissions) ReadCluster ¶
func (p Permissions) ReadCluster(resource string) bool
func (Permissions) ReadGroup ¶
func (p Permissions) ReadGroup(resource string) bool
func (Permissions) ReadTopic ¶
func (p Permissions) ReadTopic(resource string) bool
func (Permissions) UpdateTopic ¶
func (p Permissions) UpdateTopic(resource string) bool
func (Permissions) WriteCluster ¶
func (p Permissions) WriteCluster(resource string) bool
Click to show internal directories.
Click to hide internal directories.