Documentation ¶
Overview ¶
Package pgsql stores and retrieves MDM data from PostgresSQL
Index ¶
- Variables
- type Option
- type PgSQLStorage
- func (s *PgSQLStorage) AssociateCertHash(r *mdm.Request, hash string) error
- func (s *PgSQLStorage) ClearQueue(r *mdm.Request) error
- func (s *PgSQLStorage) Disable(r *mdm.Request) error
- func (s *PgSQLStorage) EnqueueCommand(ctx context.Context, ids []string, cmd *mdm.Command) (map[string]error, error)
- func (s *PgSQLStorage) EnrollmentFromHash(ctx context.Context, hash string) (string, error)
- func (s *PgSQLStorage) EnrollmentHasCertHash(r *mdm.Request, _ string) (bool, error)
- func (s *PgSQLStorage) HasCertHash(r *mdm.Request, hash string) (bool, error)
- func (s *PgSQLStorage) IsCertHashAssociated(r *mdm.Request, hash string) (bool, error)
- func (s *PgSQLStorage) IsPushCertStale(ctx context.Context, topic, staleToken string) (bool, error)
- func (s *PgSQLStorage) RetrieveBootstrapToken(r *mdm.Request, _ *mdm.GetBootstrapToken) (*mdm.BootstrapToken, error)
- func (s *PgSQLStorage) RetrieveMigrationCheckins(ctx context.Context, c chan<- interface{}) error
- func (s *PgSQLStorage) RetrieveNextCommand(r *mdm.Request, skipNotNow bool) (*mdm.Command, error)
- func (s *PgSQLStorage) RetrievePushCert(ctx context.Context, topic string) (*tls.Certificate, string, error)
- func (s *PgSQLStorage) RetrievePushInfo(ctx context.Context, ids []string) (map[string]*mdm.Push, error)
- func (s *PgSQLStorage) RetrieveTokenUpdateTally(ctx context.Context, id string) (int, error)
- func (s *PgSQLStorage) StoreAuthenticate(r *mdm.Request, msg *mdm.Authenticate) error
- func (s *PgSQLStorage) StoreBootstrapToken(r *mdm.Request, msg *mdm.SetBootstrapToken) error
- func (s *PgSQLStorage) StoreCommandReport(r *mdm.Request, result *mdm.CommandResults) error
- func (s *PgSQLStorage) StorePushCert(ctx context.Context, pemCert, pemKey []byte) error
- func (s *PgSQLStorage) StoreTokenUpdate(r *mdm.Request, msg *mdm.TokenUpdate) error
- func (s *PgSQLStorage) StoreUserAuthenticate(r *mdm.Request, msg *mdm.UserAuthenticate) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoCert = errors.New("no certificate in MDM Request")
View Source
var Schema string
Schema holds the schema for the NanoMDM PostgresSQL storage.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*config)
func WithDeleteCommands ¶
func WithDeleteCommands() Option
func WithDriver ¶
func WithLogger ¶
type PgSQLStorage ¶
type PgSQLStorage struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...Option) (*PgSQLStorage, error)
func (*PgSQLStorage) AssociateCertHash ¶
func (s *PgSQLStorage) AssociateCertHash(r *mdm.Request, hash string) error
AssociateCertHash "DO NOTHING" on duplicated keys
func (*PgSQLStorage) ClearQueue ¶
func (s *PgSQLStorage) ClearQueue(r *mdm.Request) error
func (*PgSQLStorage) Disable ¶
func (s *PgSQLStorage) Disable(r *mdm.Request) error
Disable can be called for an Authenticate or CheckOut message
func (*PgSQLStorage) EnqueueCommand ¶
func (*PgSQLStorage) EnrollmentFromHash ¶ added in v0.6.0
func (*PgSQLStorage) EnrollmentHasCertHash ¶
func (*PgSQLStorage) HasCertHash ¶
func (*PgSQLStorage) IsCertHashAssociated ¶
func (*PgSQLStorage) IsPushCertStale ¶
func (*PgSQLStorage) RetrieveBootstrapToken ¶
func (s *PgSQLStorage) RetrieveBootstrapToken(r *mdm.Request, _ *mdm.GetBootstrapToken) (*mdm.BootstrapToken, error)
func (*PgSQLStorage) RetrieveMigrationCheckins ¶
func (s *PgSQLStorage) RetrieveMigrationCheckins(ctx context.Context, c chan<- interface{}) error
func (*PgSQLStorage) RetrieveNextCommand ¶
func (*PgSQLStorage) RetrievePushCert ¶
func (s *PgSQLStorage) RetrievePushCert(ctx context.Context, topic string) (*tls.Certificate, string, error)
func (*PgSQLStorage) RetrievePushInfo ¶
func (s *PgSQLStorage) RetrievePushInfo(ctx context.Context, ids []string) (map[string]*mdm.Push, error)
RetrievePushInfo retreives push info for identifiers ids.
Note that we may return fewer results than input. The user of this method needs to reconcile that with their requested ids.
func (*PgSQLStorage) RetrieveTokenUpdateTally ¶
func (*PgSQLStorage) StoreAuthenticate ¶
func (s *PgSQLStorage) StoreAuthenticate(r *mdm.Request, msg *mdm.Authenticate) error
func (*PgSQLStorage) StoreBootstrapToken ¶
func (s *PgSQLStorage) StoreBootstrapToken(r *mdm.Request, msg *mdm.SetBootstrapToken) error
func (*PgSQLStorage) StoreCommandReport ¶
func (s *PgSQLStorage) StoreCommandReport(r *mdm.Request, result *mdm.CommandResults) error
func (*PgSQLStorage) StorePushCert ¶
func (s *PgSQLStorage) StorePushCert(ctx context.Context, pemCert, pemKey []byte) error
func (*PgSQLStorage) StoreTokenUpdate ¶
func (s *PgSQLStorage) StoreTokenUpdate(r *mdm.Request, msg *mdm.TokenUpdate) error
func (*PgSQLStorage) StoreUserAuthenticate ¶
func (s *PgSQLStorage) StoreUserAuthenticate(r *mdm.Request, msg *mdm.UserAuthenticate) error
Click to show internal directories.
Click to hide internal directories.