AuthService represents a service for managing auths.
| 71 | |
| 72 | // AuthService represents a service for managing auths. |
| 73 | type AuthService interface { |
| 74 | // Looks up an authentication object by ID along with the associated user. |
| 75 | // Returns ENOTFOUND if ID does not exist. |
| 76 | FindAuthByID(ctx context.Context, id int) (*Auth, error) |
| 77 | |
| 78 | // Retrieves authentication objects based on a filter. Also returns the |
| 79 | // total number of objects that match the filter. This may differ from the |
| 80 | // returned object count if the Limit field is set. |
| 81 | FindAuths(ctx context.Context, filter AuthFilter) ([]*Auth, int, error) |
| 82 | |
| 83 | // Creates a new authentication object If a User is attached to auth, then |
| 84 | // the auth object is linked to an existing user. Otherwise a new user |
| 85 | // object is created. |
| 86 | // |
| 87 | // On success, the auth.ID is set to the new authentication ID. |
| 88 | CreateAuth(ctx context.Context, auth *Auth) error |
| 89 | |
| 90 | // Permanently deletes an authentication object from the system by ID. |
| 91 | // The parent user object is not removed. |
| 92 | DeleteAuth(ctx context.Context, id int) error |
| 93 | } |
| 94 | |
| 95 | // AuthFilter represents a filter accepted by FindAuths(). |
| 96 | type AuthFilter struct { |
no outgoing calls
no test coverage detected