lock

package
v0.0.0-...-0943219 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("user not found")
)

Functions

This section is empty.

Types

type EtcdUserDatabase

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

func NewEtcdUserDatabase

func NewEtcdUserDatabase(endpoint string) (*EtcdUserDatabase, error)

func (*EtcdUserDatabase) GetUser

func (db *EtcdUserDatabase) GetUser(ctx context.Context, id int) (*User, error)

func (*EtcdUserDatabase) SafeUpdateUser

func (db *EtcdUserDatabase) SafeUpdateUser(ctx context.Context, id int, ttl int, update func(*User) bool) error

func (*EtcdUserDatabase) SetUser

func (db *EtcdUserDatabase) SetUser(ctx context.Context, user *User) error

func (*EtcdUserDatabase) UpdateUser

func (db *EtcdUserDatabase) UpdateUser(ctx context.Context, id int, ttl int, update func(*User) bool) error

type User

type User struct {
	Id   int    `yaml:"id"`
	Name string `yaml:"name"`
}

Jump to

Keyboard shortcuts

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