directory

package module
v0.0.0-...-cdc24ad Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 1 Imported by: 2

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

	Description 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 Group

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

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

	Parent string `json:"parent,omitempty"`

	Description string `json:"description,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 Provider

type Provider 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)
	UpdateUser(ctx context.Context, userID string, options *UpdateUserOptions) (*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)
	UpdateGroup(ctx context.Context, groupID string, options *UpdateGroupOptions) (*Group, error)
	DeleteGroup(ctx context.Context, groupID string, options *DeleteGroupOptions) 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 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 UpdateGroupOptions

type UpdateGroupOptions struct {
	Description *string `json:"description,omitempty"`

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

type UpdateUserOptions

type UpdateUserOptions struct {
	FirstName *string
	LastName  *string
}

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
pkg
to
provider

Jump to

Keyboard shortcuts

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