MCPcopy
hub / github.com/benbjohnson/wtf / AuthService

Interface AuthService

auth.go:73–93  ·  view source on GitHub ↗

AuthService represents a service for managing auths.

Source from the content-addressed store, hash-verified

71
72// AuthService represents a service for managing auths.
73type 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().
96type AuthFilter struct {

Callers 9

MustCreateAuthFunction · 0.65
TestAuthService_FindAuthFunction · 0.95

Implementers 2

AuthServicemock/auth.go
AuthServicesqlite/auth.go

Calls

no outgoing calls

Tested by

no test coverage detected