types

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidGroupType = errors.New("invalid group type")
	ErrInvalidRole      = errors.New("invalid role")
)

Functions

This section is empty.

Types

type Group

type Group struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	TenantId    string    `json:"tenant" default:"default"`
	Description string    `json:"description"`
	Type        GroupType `json:"type" default:"local"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

Group represents a group of users.

type GroupType

type GroupType int
const (
	GroupTypeLocal    GroupType = 0
	GroupTypeExternal GroupType = 1
)

func ParseGroupType

func ParseGroupType(s string) (GroupType, error)

ParseGroupType converts a string to a GroupType.

func (GroupType) MarshalJSON

func (t GroupType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (GroupType) String

func (t GroupType) String() string

func (*GroupType) UnmarshalJSON

func (t *GroupType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals a quoted json string to the enum value

type GroupUser

type GroupUser struct {
	ID       string `json:"id"`
	Role     Role   `json:"role"`
	TenantId string `json:"tenant" default:"default"`
}

GroupUser represents a user's membership in a group.

type Role

type Role int
const (
	RoleMember Role = 0
	RoleOwner  Role = 1
)

func ParseRole

func ParseRole(s string) (Role, error)

ParseRole converts a string to a Role.

func (Role) MarshalJSON

func (r Role) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (Role) String

func (r Role) String() string

func (*Role) UnmarshalJSON

func (r *Role) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals a quoted json string to the enum value

Jump to

Keyboard shortcuts

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