Documentation ¶ Index ¶ Variables func StoreUser(ctx context.Context, user User) context.Context type Authorization type Identification type Storage type User func NewUser(id uint64, name string) User func ReadUser(ctx context.Context) (output User) func (u User) IsZero() bool Constants ¶ This section is empty. Variables ¶ View Source var ( ErrForbidden = errors.New("forbidden access") ErrUnknownUser = errors.New("unknown user") ErrMalformedContent = errors.New("malformed content") ErrUnavailableService = errors.New("unavailable service") ErrInvalidCredentials = errors.New("invalid credentials") ) Functions ¶ func StoreUser ¶ func StoreUser(ctx context.Context, user User) context.Context Types ¶ type Authorization ¶ type Authorization interface { IsAuthorized(context.Context, User, string) bool OnForbidden(http.ResponseWriter, *http.Request, User, string) } type Identification ¶ type Identification interface { GetUser(context.Context, *http.Request) (User, error) OnError(http.ResponseWriter, *http.Request, error) } type Storage ¶ type Storage interface { Create(context.Context) (User, error) Delete(context.Context, User) error } type User ¶ type User struct { Name string `json:"name"` ID uint64 `json:"id"` } func NewUser ¶ func NewUser(id uint64, name string) User func ReadUser ¶ func ReadUser(ctx context.Context) (output User) func (User) IsZero ¶ func (u User) IsZero() bool Source Files ¶ View all Source files interfaces.gouser.go Click to show internal directories. Click to hide internal directories.