Documentation ¶ Index ¶ Variables func StoreUser(ctx context.Context, user User) context.Context type Authentication type Authorization type Link type Storage type User func NewUser(name string) User func ReadUser(ctx context.Context) (output User) Constants ¶ This section is empty. Variables ¶ View Source var ( ErrForbidden = errors.New("forbidden access") ErrUnknownUser = errors.New("unknown user") ErrUnknownLink = errors.New("unknown link") 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 Authentication ¶ added in v3.1.0 type Authentication interface { GetUser(context.Context, *http.Request) (User, error) OnUnauthorized(http.ResponseWriter, *http.Request, error) } type Authorization ¶ type Authorization interface { IsAuthorized(context.Context, *http.Request, User) bool OnForbidden(http.ResponseWriter, *http.Request, User) } type Link ¶ added in v3.6.0 type Link struct { ExternalID string Description string } type Storage ¶ type Storage interface { Create(context.Context, string) (User, error) Delete(context.Context, User) error } type User ¶ type User struct { ID string `json:"id"` Name string `json:"name"` Image string `json:"image"` } func NewUser ¶ func NewUser(name string) User func ReadUser ¶ func ReadUser(ctx context.Context) (output User) Source Files ¶ View all Source files interfaces.golink.gouser.go Click to show internal directories. Click to hide internal directories.