syncer

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummySyncer

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

DummySyncer emulates synchronization with OS-local users/groups.

func NewDummySyncer

func NewDummySyncer() *DummySyncer

NewDummySyncer creates a DummySyncer.

func (*DummySyncer) AddGroup

func (s *DummySyncer) AddGroup(ctx context.Context, g etcdpasswd.Group) error

AddGroup implements etcdpasswd.Syncer interface.

func (*DummySyncer) AddUser

func (s *DummySyncer) AddUser(ctx context.Context, u *etcdpasswd.User) error

AddUser implements etcdpasswd.Syncer interface.

func (*DummySyncer) LockPassword

func (s *DummySyncer) LockPassword(ctx context.Context, name string) error

LockPassword implements etcdpasswd.Syncer interface.

func (*DummySyncer) LookupGroup

func (s *DummySyncer) LookupGroup(ctx context.Context, name string) (*etcdpasswd.Group, error)

LookupGroup implements etcdpasswd.Syncer interface.

func (*DummySyncer) LookupUser

func (s *DummySyncer) LookupUser(ctx context.Context, name string) (*etcdpasswd.User, error)

LookupUser implements etcdpasswd.Syncer interface.

func (*DummySyncer) RemoveGroup

func (s *DummySyncer) RemoveGroup(ctx context.Context, name string) error

RemoveGroup implements etcdpasswd.Syncer interface.

func (*DummySyncer) RemoveUser

func (s *DummySyncer) RemoveUser(ctx context.Context, name string) error

RemoveUser implements etcdpasswd.Syncer interface.

func (*DummySyncer) SetDisplayName

func (s *DummySyncer) SetDisplayName(ctx context.Context, name, displayName string) error

SetDisplayName implements etcdpasswd.Syncer interface.

func (*DummySyncer) SetPrimaryGroup

func (s *DummySyncer) SetPrimaryGroup(ctx context.Context, name, group string) error

SetPrimaryGroup implements etcdpasswd.Syncer interface.

func (*DummySyncer) SetPubKeys

func (s *DummySyncer) SetPubKeys(ctx context.Context, name string, pubkeys []string) error

SetPubKeys implements etcdpasswd.Syncer interface.

func (*DummySyncer) SetShell

func (s *DummySyncer) SetShell(ctx context.Context, name, shell string) error

SetShell implements etcdpasswd.Syncer interface.

func (*DummySyncer) SetSupplementalGroups

func (s *DummySyncer) SetSupplementalGroups(ctx context.Context, name string, groups []string) error

SetSupplementalGroups implements etcdpasswd.Syncer interface.

type MockSyncer

type MockSyncer struct {
	Users       map[string]*etcdpasswd.User
	Groups      map[string]*etcdpasswd.Group
	LockedUsers map[string]bool
}

MockSyncer is a memory-only synchronizer for tests.

func NewMockSyncer

func NewMockSyncer() *MockSyncer

NewMockSyncer creates a MockSyncer instance.

func (*MockSyncer) AddGroup

func (s *MockSyncer) AddGroup(ctx context.Context, group etcdpasswd.Group) error

AddGroup implements etcdpasswd.Syncer interface.

func (*MockSyncer) AddUser

func (s *MockSyncer) AddUser(ctx context.Context, user *etcdpasswd.User) error

AddUser implements etcdpasswd.Syncer interface.

func (*MockSyncer) LockPassword

func (s *MockSyncer) LockPassword(ctx context.Context, name string) error

LockPassword implements etcdpasswd.Syncer interface.

func (*MockSyncer) LookupGroup

func (s *MockSyncer) LookupGroup(ctx context.Context, name string) (*etcdpasswd.Group, error)

LookupGroup implements etcdpasswd.Syncer interface.

func (*MockSyncer) LookupUser

func (s *MockSyncer) LookupUser(ctx context.Context, name string) (*etcdpasswd.User, error)

LookupUser implements etcdpasswd.Syncer interface.

func (*MockSyncer) RemoveGroup

func (s *MockSyncer) RemoveGroup(ctx context.Context, name string) error

RemoveGroup implements etcdpasswd.Syncer interface.

func (*MockSyncer) RemoveUser

func (s *MockSyncer) RemoveUser(ctx context.Context, name string) error

RemoveUser implements etcdpasswd.Syncer interface.

func (*MockSyncer) SetDisplayName

func (s *MockSyncer) SetDisplayName(ctx context.Context, name, displayName string) error

SetDisplayName implements etcdpasswd.Syncer interface.

func (*MockSyncer) SetPrimaryGroup

func (s *MockSyncer) SetPrimaryGroup(ctx context.Context, name, group string) error

SetPrimaryGroup implements etcdpasswd.Syncer interface.

func (*MockSyncer) SetPubKeys

func (s *MockSyncer) SetPubKeys(ctx context.Context, name string, pubkeys []string) error

SetPubKeys implements etcdpasswd.Syncer interface.

func (*MockSyncer) SetShell

func (s *MockSyncer) SetShell(ctx context.Context, name, shell string) error

SetShell implements etcdpasswd.Syncer interface.

func (*MockSyncer) SetSupplementalGroups

func (s *MockSyncer) SetSupplementalGroups(ctx context.Context, name string, groups []string) error

SetSupplementalGroups implements etcdpasswd.Syncer interface.

type UbuntuSyncer

type UbuntuSyncer struct{}

UbuntuSyncer synchronizes with local users/groups of Debian/Ubuntu OS.

func (UbuntuSyncer) AddGroup

func (s UbuntuSyncer) AddGroup(ctx context.Context, g etcdpasswd.Group) error

AddGroup implements etcdpasswd.Syncer interface.

func (UbuntuSyncer) AddUser

func (s UbuntuSyncer) AddUser(ctx context.Context, u *etcdpasswd.User) error

AddUser implements etcdpasswd.Syncer interface.

func (UbuntuSyncer) LockPassword

func (s UbuntuSyncer) LockPassword(ctx context.Context, name string) error

LockPassword implements etcdpasswd.Syncer interface.

func (UbuntuSyncer) LookupGroup

func (s UbuntuSyncer) LookupGroup(ctx context.Context, name string) (*etcdpasswd.Group, error)

LookupGroup implements etcdpasswd.Syncer interface.

func (UbuntuSyncer) LookupUser

func (s UbuntuSyncer) LookupUser(ctx context.Context, name string) (*etcdpasswd.User, error)

LookupUser implements etcdpasswd.Syncer interface.

func (UbuntuSyncer) RemoveGroup

func (s UbuntuSyncer) RemoveGroup(ctx context.Context, name string) error

RemoveGroup implements etcdpasswd.Syncer interface.

func (UbuntuSyncer) RemoveUser

func (s UbuntuSyncer) RemoveUser(ctx context.Context, name string) error

RemoveUser implements etcdpasswd.Syncer interface.

func (UbuntuSyncer) SetDisplayName

func (s UbuntuSyncer) SetDisplayName(ctx context.Context, name, displayName string) error

SetDisplayName implements etcdpasswd.Syncer interface.

func (UbuntuSyncer) SetPrimaryGroup

func (s UbuntuSyncer) SetPrimaryGroup(ctx context.Context, name, group string) error

SetPrimaryGroup implements etcdpasswd.Syncer interface.

func (UbuntuSyncer) SetPubKeys

func (s UbuntuSyncer) SetPubKeys(ctx context.Context, name string, pubkeys []string) error

SetPubKeys implements etcdpasswd.Syncer interface.

func (UbuntuSyncer) SetShell

func (s UbuntuSyncer) SetShell(ctx context.Context, name, shell string) error

SetShell implements etcdpasswd.Syncer interface.

func (UbuntuSyncer) SetSupplementalGroups

func (s UbuntuSyncer) SetSupplementalGroups(ctx context.Context, name string, groups []string) error

SetSupplementalGroups implements etcdpasswd.Syncer interface.

Jump to

Keyboard shortcuts

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