directory

package module
v0.0.0-...-9321e41 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateGroupOptions

type CreateGroupOptions struct {
	Kind   string
	Parent string
}

type CreateRoleOptions

type CreateRoleOptions struct {
}

type CreateUserOptions

type CreateUserOptions struct {
	Kind string
	Name string

	FirstName string
	LastName  string
}

type DeleteGroupOptions

type DeleteGroupOptions struct {
}

type DeleteRoleOptions

type DeleteRoleOptions struct {
}

type DeleteUserOptions

type DeleteUserOptions struct {
}

type Directory

type Directory interface {
	User(ctx context.Context, userID string) (*User, error)
	Users(ctx context.Context, options *UserListOptions) ([]User, error)

	CreateUser(ctx context.Context, username string, options *CreateUserOptions) (*User, error)
	DeleteUser(ctx context.Context, userID string, options *DeleteUserOptions) error

	Group(ctx context.Context, groupID string) (*Group, error)
	Groups(ctx context.Context, options *GroupListOptions) ([]Group, error)

	CreateGroup(ctx context.Context, name string, options *CreateGroupOptions) (*Group, error)
	DeleteGroup(ctx context.Context, groupID string, options *DeleteGroupOptions) error

	UpdateGroupExtensions(ctx context.Context, groupID string, extensions map[string]string) error

	Members(ctx context.Context, groupID string, options *MemberListOptions) ([]Member, error)

	AddMember(ctx context.Context, groupID, userID string) error
	RemoveMember(ctx context.Context, groupID, userID string) error

	Role(ctx context.Context, roleID string) (*Role, error)
	Roles(ctx context.Context, groupID string, options *RoleListOptions) ([]Role, error)

	CreateRole(ctx context.Context, groupID, name string, options *CreateRoleOptions) (*Role, error)
	DeleteRole(ctx context.Context, roleID string, options *DeleteRoleOptions) error

	AssignRole(ctx context.Context, roleID, userID string) error
	RemoveRole(ctx context.Context, roleID, userID string) error
}

type Group

type Group struct {
	ID string `json:"id,omitempty"`

	Kind string `json:"kind,omitempty"`
	Name string `json:"name,omitempty"`

	Parent string `json:"parent,omitempty"`

	Extensions map[string]string `json:"extensions,omitempty"`
}

type GroupListOptions

type GroupListOptions struct {
	FilterKind   string
	FilterParent string
}

type Member

type Member struct {
	User  `json:",inline"`
	Roles []string `json:"roles,omitempty"`
}

type MemberListOptions

type MemberListOptions struct {
}

type Role

type Role struct {
	ID string `json:"id,omitempty"`

	Kind string `json:"kind,omitempty"`
	Name string `json:"name,omitempty"`
}

type RoleListOptions

type RoleListOptions struct {
}

type User

type User struct {
	ID string `json:"id,omitempty"`

	Kind string `json:"kind,omitempty"`
	Name string `json:"name,omitempty"`

	FirstName string `json:"firstName,omitempty"`
	LastName  string `json:"lastName,omitempty"`

	Username string `json:"username,omitempty"`
	Nickname string `json:"nickname,omitempty"`

	Mail  string `json:"mail,omitempty"`
	Phone string `json:"phone,omitempty"`

	Profile string `json:"profile,omitempty"`
	Picture string `json:"picture,omitempty"`
	Website string `json:"website,omitempty"`
}

type UserListOptions

type UserListOptions struct {
}

Directories

Path Synopsis
cmd
to
provider

Jump to

Keyboard shortcuts

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