Documentation ¶
Overview ¶
Package sql implements a persistent SQL data store. It implements the RegistrationStorer interface.
Index ¶
- type Config
- type DeploymentFields
- type RegistrationFields
- type Store
- func (s *Store) FindDeployment(issuer, deploymentID string) (datastore.Deployment, error)
- func (s *Store) FindRegistrationByIssuerAndClientID(issuer, clientID string) (datastore.Registration, error)
- func (s *Store) StoreDeployment(issuer string, d datastore.Deployment) error
- func (s *Store) StoreRegistration(reg datastore.Registration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { RegistrationTable string RegistrationFields RegistrationFields DeploymentTable string DeploymentFields DeploymentFields }
Config represents the table and field names necessary for storing/retrieving registrations and deployments within the database.
type DeploymentFields ¶
DeploymentFields provides the database column names for fields in the datastore.Deployment structure.
type RegistrationFields ¶
type RegistrationFields struct { Issuer string ClientID string AuthTokenURI string AuthLoginURI string KeysetURI string TargetLinkURI string }
RegistrationFields provides the database column names for fields in the datastore.Registration structure.
type Store ¶
Store implements a persistent SQL-based datastore.
func New ¶
New returns a Store that satisifes the datastore.RegistrationStorer and datastore.DeploymentStorer interfaces.
func (*Store) FindDeployment ¶
func (s *Store) FindDeployment(issuer, deploymentID string) (datastore.Deployment, error)
FindDeployment looks up and returns either a Deployment by the issuer and deployment ID or the datastore error ErrDeploymentNotFound.
func (*Store) FindRegistrationByIssuerAndClientID ¶
func (s *Store) FindRegistrationByIssuerAndClientID(issuer, clientID string) (datastore.Registration, error)
FindRegistrationByIssuerAndClientID retrieves a registration from the SQL database.
func (*Store) StoreDeployment ¶
func (s *Store) StoreDeployment(issuer string, d datastore.Deployment) error
StoreDeployment stores a deployment in the SQL database.
func (*Store) StoreRegistration ¶
func (s *Store) StoreRegistration(reg datastore.Registration) error
StoreRegistration stores a registration in the SQL database.