types

package
v0.1.61 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TruncateString added in v0.1.59

func TruncateString(s string, maxLen int) string

TruncateString replaces newlines with spaces and truncates s to maxLen characters, appending "..." if truncated.

Types

type Permissions added in v0.1.59

type Permissions struct {
	Owners  RoleGrant `json:"owners"`
	Members RoleGrant `json:"members"`
}

Permissions configures RBAC with owner and member roles. An empty config (all slices nil/empty) allows all users as owners (bootstrap mode).

func (Permissions) GetRole added in v0.1.59

func (p Permissions) GetRole(authorID string, authorRoles []string) Role

GetRole returns the role for the given author based on grants. Returns "" when the author is not granted any role.

func (Permissions) IsEmpty added in v0.1.59

func (p Permissions) IsEmpty() bool

IsEmpty returns true when no role grants are configured.

type Platform

type Platform string

Platform represents the chat platform type.

const (
	PlatformDiscord Platform = "discord"
	PlatformSlack   Platform = "slack"
)

type Role added in v0.1.41

type Role string

Role represents the RBAC role for channel access control.

const (
	RoleOwner  Role = "owner"
	RoleMember Role = "member"
)

type RoleGrant added in v0.1.59

type RoleGrant struct {
	Users []string `json:"users"` // platform user IDs
	Roles []string `json:"roles"` // Discord role IDs (ignored on Slack)
}

RoleGrant lists the users and platform role IDs that are granted a specific RBAC role.

Jump to

Keyboard shortcuts

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