Documentation ¶
Overview ¶
Package events contains methods to publish group memberships info to the permissions-api
Index ¶
- Constants
- type Events
- func (e *Events) AddGroupMembers(ctx context.Context, gid gidx.PrefixedID, subjIDs ...gidx.PrefixedID) error
- func (e *Events) CreateGroup(ctx context.Context, parentID, gid gidx.PrefixedID) error
- func (e *Events) DeleteGroup(ctx context.Context, parentID, gid gidx.PrefixedID) error
- func (e *Events) RemoveGroupMembers(ctx context.Context, gid gidx.PrefixedID, subjIDs ...gidx.PrefixedID) error
- type GroupService
- type Opt
- type Service
Constants ¶
View Source
const ( // DirectMemberRelationship is the direct member relationship. DirectMemberRelationship = "direct_member" // GroupParentRelationship is the group parent relationship. GroupParentRelationship = "parent" // GroupTopic is the group topic. GroupTopic = "group" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events represents a collection of relationships.
func NewEvents ¶
NewEvents creates a new Relationships instance with the given NATS URL and options.
func (*Events) AddGroupMembers ¶
func (e *Events) AddGroupMembers(ctx context.Context, gid gidx.PrefixedID, subjIDs ...gidx.PrefixedID) error
AddGroupMembers adds subjects to a group.
func (*Events) CreateGroup ¶
CreateGroup creates a group.
func (*Events) DeleteGroup ¶
DeleteGroup deletes a group.
func (*Events) RemoveGroupMembers ¶
func (e *Events) RemoveGroupMembers(ctx context.Context, gid gidx.PrefixedID, subjIDs ...gidx.PrefixedID) error
RemoveGroupMembers removes subjects from a group.
type GroupService ¶
type GroupService interface { // AddGroupMembers adds subjects to a group. AddGroupMembers(ctx context.Context, gid gidx.PrefixedID, subjIDs ...gidx.PrefixedID) error // RemoveGroupMembers removes subjects from a group. RemoveGroupMembers(ctx context.Context, gid gidx.PrefixedID, subjIDs ...gidx.PrefixedID) error // CreateGroup creates a group. CreateGroup(ctx context.Context, parentID, gid gidx.PrefixedID) error // DeleteGroup deletes a group. DeleteGroup(ctx context.Context, parentID, gid gidx.PrefixedID) error }
GroupService provides group-related event publishing and handling.
type Opt ¶
type Opt func(*Events)
Opt represents an option for configuring Relationships.
func WithLogger ¶
WithLogger is an option to set the logger for Relationships.
type Service ¶
type Service interface { GroupService }
Service is the interface for the events service.
Click to show internal directories.
Click to hide internal directories.