lavender/client-store/client-store.go

23 lines
437 B
Go
Raw Normal View History

2024-02-07 01:18:17 +00:00
package client_store
import (
"context"
"github.com/1f349/lavender/database"
"github.com/go-oauth2/oauth2/v4"
)
type ClientStore struct {
db *database.Queries
2024-02-07 01:18:17 +00:00
}
var _ oauth2.ClientStore = &ClientStore{}
func New(db *database.Queries) *ClientStore {
2024-02-07 01:18:17 +00:00
return &ClientStore{db: db}
}
func (c *ClientStore) GetByID(ctx context.Context, id string) (oauth2.ClientInfo, error) {
a, err := c.db.GetClientInfo(ctx, id)
return &a, err
2024-02-07 01:18:17 +00:00
}