Documentation ¶
Index ¶
- func GetStorageType()
- func Open()
- type User
- type UserMemoryStorage
- func (s *UserMemoryStorage) CreateUser(ctx context.Context, u User) (string, error)
- func (s *UserMemoryStorage) DeleteUser(ctx context.Context, id string) error
- func (s *UserMemoryStorage) GetUser(ctx context.Context, id string) (User, error)
- func (s *UserMemoryStorage) ListUser(ctx context.Context) ([]User, error)
- func (s *UserMemoryStorage) UpdateUser(ctx context.Context, u User) error
- type UserStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type User ¶
type User struct { ID string `json:"id"` Username string `json:"username"` Password string `json:"-"` State uint32 `json:"state"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
User User
type UserMemoryStorage ¶
type UserMemoryStorage struct {
// contains filtered or unexported fields
}
UserMemoryStorage UserMemoryStorage
func NewUserMemoryStorage ¶
func NewUserMemoryStorage() *UserMemoryStorage
NewUserMemoryStorage NewUserMemoryStorage
func (*UserMemoryStorage) CreateUser ¶
CreateUser CreateUser
func (*UserMemoryStorage) DeleteUser ¶
func (s *UserMemoryStorage) DeleteUser(ctx context.Context, id string) error
DeleteUser DeleteUser
func (*UserMemoryStorage) ListUser ¶
func (s *UserMemoryStorage) ListUser(ctx context.Context) ([]User, error)
ListUser ListUser
func (*UserMemoryStorage) UpdateUser ¶
func (s *UserMemoryStorage) UpdateUser(ctx context.Context, u User) error
UpdateUser UpdateUser
type UserStorage ¶
type UserStorage interface { ListUser(ctx context.Context) ([]User, error) GetUser(ctx context.Context, id string) (User, error) CreateUser(ctx context.Context, u User) (string, error) UpdateUser(ctx context.Context, u User) error DeleteUser(ctx context.Context, id string) error }
UserStorage UserStorage
Click to show internal directories.
Click to hide internal directories.