Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authentication ¶
type Authentication struct { Account account.Account `json:"account"` Service Service `json:"service"` Identifier string `json:"identifier"` Token string `json:"-"` Metadata interface{} `json:"metadata,omitempty"` }
func FromModel ¶
func FromModel(m *model.Authentication) *Authentication
func FromModelMany ¶
func FromModelMany(m []*model.Authentication) []Authentication
type Repository ¶
type Repository interface { // Create an auth method for a account. Create(ctx context.Context, userID account.AccountID, service Service, identifier string, token string, metadata map[string]any, ) (*Authentication, error) // Gets an auth method based on a service's external account ID. GetByIdentifier(ctx context.Context, service Service, identifier string) (*Authentication, error) // Gets all auth methods that a account has. GetAuthMethods(ctx context.Context, userID account.AccountID) ([]Authentication, error) // Checks if the given token is equal to the stored auth method's token. IsEqual(ctx context.Context, userID account.AccountID, identifier string, token string) (bool, error) }
func New ¶
func New(db *model.Client) Repository
Click to show internal directories.
Click to hide internal directories.