models

package
v2.3.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDifferentArgumentsTypes = errors.New("src and dst must be of same type")
)

Functions

This section is empty.

Types

type ACL

type ACL idm.ACL

func (*ACL) Equals

func (a *ACL) Equals(o Differ) bool

func (*ACL) GetUniqueId

func (a *ACL) GetUniqueId() string

func (*ACL) IsDeletable

func (a *ACL) IsDeletable(m map[string]string) bool

func (*ACL) IsMergeable

func (a *ACL) IsMergeable(o Differ) bool

test if two user can be mergeable whose the same login name and auth source

func (*ACL) Merge

func (a *ACL) Merge(o Differ, options map[string]string) (Differ, error)

type ACLDiff

type ACLDiff struct {
	// contains filtered or unexported fields
}

func (*ACLDiff) Add

func (a *ACLDiff) Add(vs ...interface{})

func (*ACLDiff) Delete

func (a *ACLDiff) Delete(vs ...interface{})

func (*ACLDiff) ToAdd

func (a *ACLDiff) ToAdd() []interface{}

func (*ACLDiff) ToDelete

func (a *ACLDiff) ToDelete() []interface{}

func (*ACLDiff) ToUpdate

func (a *ACLDiff) ToUpdate() []interface{}

func (*ACLDiff) Update

func (a *ACLDiff) Update(vs ...interface{})

type Config

type Config source.ChangeSet

func (*Config) Equals

func (c *Config) Equals(o Differ) bool

func (*Config) GetUniqueId

func (c *Config) GetUniqueId() string

func (*Config) IsDeletable

func (c *Config) IsDeletable(m map[string]string) bool

func (*Config) IsMergeable

func (c *Config) IsMergeable(o Differ) bool

test if two user can be mergeable whose the same login name and auth source

func (*Config) Merge

func (c *Config) Merge(o Differ, options map[string]string) (Differ, error)

type ConfigDiff

type ConfigDiff struct {
	// contains filtered or unexported fields
}

func (*ConfigDiff) Add

func (a *ConfigDiff) Add(vs ...interface{})

func (*ConfigDiff) Delete

func (a *ConfigDiff) Delete(vs ...interface{})

func (*ConfigDiff) GetUpdateData

func (a *ConfigDiff) GetUpdateData() []byte

func (*ConfigDiff) ToAdd

func (a *ConfigDiff) ToAdd() []interface{}

func (*ConfigDiff) ToDelete

func (a *ConfigDiff) ToDelete() []interface{}

func (*ConfigDiff) ToUpdate

func (a *ConfigDiff) ToUpdate() []interface{}

func (*ConfigDiff) Update

func (a *ConfigDiff) Update(vs ...interface{})

type Diff

type Diff interface {
	Add(...interface{})
	Update(...interface{})
	Delete(...interface{})
	ToAdd() []interface{}
	ToUpdate() []interface{}
	ToDelete() []interface{}
}

type Differ

type Differ interface {
	Equals(Differ) bool
	IsDeletable(m map[string]string) bool
	IsMergeable(Differ) bool
	GetUniqueId() string
	Merge(Differ, map[string]string) (Differ, error)
}

type GroupDiff

type GroupDiff struct {
	// List of user to be updated
	Update map[string]*idm.User

	// List of user to be deleted
	Delete map[string]*idm.User

	// List of user to be created
	Create map[string]*idm.User
}

type MergeOptions

type MergeOptions struct {
	SyncType   MergeSyncType
	Origin     string
	AuthSource string
	RolePrefix string
}

func (*MergeOptions) ToMap

func (m *MergeOptions) ToMap() map[string]string

type MergeSyncType

type MergeSyncType int
const (
	FULLSYNC MergeSyncType = iota
	CREATEONLYSYNC
	NODELETESYNC
)

type PhpUserMeta

type PhpUserMeta struct {
	NodeName string
	UserName string
	Meta     map[string]interface{}
}

func Map2LocalMeta

func Map2LocalMeta(m map[string]interface{}) (out []*PhpUserMeta, e error)

func UserMetasFromPhpData

func UserMetasFromPhpData(serializedData []byte) (metas []*PhpUserMeta, outErr error)

type ReadableStore

type ReadableStore interface {
	ListConfig(context.Context, map[string]interface{}) (*source.ChangeSet, error)
	ListUsers(context.Context, map[string]interface{}, chan float32) (map[string]*idm.User, error)
	ListGroups(context.Context, map[string]interface{}) ([]*idm.User, error)
	ListRoles(context.Context, ReadableStore, map[string]interface{}) ([]*idm.Role, error)
	ListACLs(context.Context, map[string]interface{}) ([]*idm.ACL, error)

	ListShares(context.Context, map[string]interface{}) ([]*SyncShare, error)
	CrossLoadShare(context.Context, *SyncShare, ReadableStore, map[string]interface{}) error

	GetUserInfo(c context.Context, userName string, params map[string]interface{}) (u *idm.User, aclCtxt context.Context, e error)
	GetGroupInfo(c context.Context, groupPath string, params map[string]interface{}) (u *idm.User, e error)
	ReadNode(c context.Context, wsUuid string, wsPath string) (*tree.Node, error)
}

ReadableStore interface defines the objects to be able to list from a store

type Role

type Role idm.Role

func (*Role) Equals

func (r *Role) Equals(differ Differ) bool

func (*Role) GetUniqueId

func (r *Role) GetUniqueId() string

func (*Role) IsDeletable

func (r *Role) IsDeletable(m map[string]string) bool

func (*Role) IsMergeable

func (r *Role) IsMergeable(d Differ) bool

func (*Role) Merge

func (r *Role) Merge(differ Differ, params map[string]string) (Differ, error)

type RoleDiff

type RoleDiff struct {
	// List of user to be updated
	Updates map[string]*idm.Role

	// List of user to be deleted
	Deletes map[string]*idm.Role

	// List of user to be created
	Creates map[string]*idm.Role
}

func NewRolesDiff

func NewRolesDiff() *RoleDiff

func (*RoleDiff) Add

func (a *RoleDiff) Add(vs ...interface{})

func (*RoleDiff) Delete

func (a *RoleDiff) Delete(vs ...interface{})

func (*RoleDiff) ToAdd

func (a *RoleDiff) ToAdd() []interface{}

func (*RoleDiff) ToDelete

func (a *RoleDiff) ToDelete() []interface{}

func (*RoleDiff) ToUpdate

func (a *RoleDiff) ToUpdate() []interface{}

func (*RoleDiff) Update

func (a *RoleDiff) Update(vs ...interface{})

type ShareDiff

type ShareDiff struct {
	// contains filtered or unexported fields
}

func (*ShareDiff) Add

func (a *ShareDiff) Add(vs ...interface{})

func (*ShareDiff) Delete

func (a *ShareDiff) Delete(vs ...interface{})

func (*ShareDiff) ToAdd

func (a *ShareDiff) ToAdd() []interface{}

func (*ShareDiff) ToDelete

func (a *ShareDiff) ToDelete() []interface{}

func (*ShareDiff) ToUpdate

func (a *ShareDiff) ToUpdate() []interface{}

func (*ShareDiff) Update

func (a *ShareDiff) Update(vs ...interface{})

type SyncShare

type SyncShare struct {
	OwnerUser    *idm.User
	OwnerContext context.Context

	Cell           *rest.Cell
	Link           *rest.ShareLink
	LinkPassword   string
	PasswordHashed bool

	InternalData interface{}
}

func (*SyncShare) Equals

func (s *SyncShare) Equals(o Differ) bool

func (*SyncShare) GetInternalData

func (s *SyncShare) GetInternalData() interface{}

func (*SyncShare) GetUniqueId

func (s *SyncShare) GetUniqueId() string

func (*SyncShare) IsDeletable

func (s *SyncShare) IsDeletable(m map[string]string) bool

func (*SyncShare) IsMergeable

func (s *SyncShare) IsMergeable(o Differ) bool

func (*SyncShare) Merge

func (s *SyncShare) Merge(o Differ, options map[string]string) (Differ, error)

type User

type User struct {
	*idm.User
}

func (*User) Equal

func (u *User) Equal(other *idm.User) bool

func (*User) GetUniqueId

func (u *User) GetUniqueId() string

func (*User) IsEmpty

func (u *User) IsEmpty() bool

func (*User) IsMergeable

func (u *User) IsMergeable(other *idm.User) bool

test if two user can be mergeable whose the same login name and auth source

func (*User) Merge

func (u *User) Merge(idmUser *idm.User, options *MergeOptions) (*idm.User, error, bool)

type UserDiff

type UserDiff struct {
	// List of user to be updated
	Update map[string]*idm.User

	// List of user to be deleted
	Delete map[string]*idm.User

	// List of user to be created
	Create map[string]*idm.User
}

func NewUserDiff

func NewUserDiff() *UserDiff

type WritableStore

type WritableStore interface {
	ReadableStore

	CreateUser(context.Context, *idm.User) (*idm.User, error)
	UpdateUser(context.Context, *idm.User) (*idm.User, error)
	DeleteUser(context.Context, *idm.User) error
	PutGroup(context.Context, *idm.User) error
	DeleteGroup(context.Context, *idm.User) error
	PutRole(context.Context, *idm.Role) (*idm.Role, error)
	DeleteRole(context.Context, *idm.Role) error
	PutACL(context.Context, *idm.ACL) error
	DeleteACL(context.Context, *idm.ACL) error
	PutConfig(context.Context, *source.ChangeSet) error
	PutShare(context.Context, *SyncShare) error
}

WritableStore defines the function required to write to a store

Jump to

Keyboard shortcuts

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