pgsql

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package pgsql stores and retrieves MDM data from PostgresSQL

Index

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 WithDB

func WithDB(db *sql.DB) Option

func WithDSN

func WithDSN(dsn string) Option

func WithDeleteCommands

func WithDeleteCommands() Option

func WithDriver

func WithDriver(driver string) Option

func WithLogger

func WithLogger(logger log.Logger) Option

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 (s *PgSQLStorage) EnqueueCommand(ctx context.Context, ids []string, cmd *mdm.Command) (map[string]error, error)

func (*PgSQLStorage) EnrollmentFromHash added in v0.6.0

func (s *PgSQLStorage) EnrollmentFromHash(ctx context.Context, hash string) (string, error)

func (*PgSQLStorage) EnrollmentHasCertHash

func (s *PgSQLStorage) EnrollmentHasCertHash(r *mdm.Request, _ string) (bool, error)

func (*PgSQLStorage) HasCertHash

func (s *PgSQLStorage) HasCertHash(r *mdm.Request, hash string) (bool, error)

func (*PgSQLStorage) IsCertHashAssociated

func (s *PgSQLStorage) IsCertHashAssociated(r *mdm.Request, hash string) (bool, error)

func (*PgSQLStorage) IsPushCertStale

func (s *PgSQLStorage) IsPushCertStale(ctx context.Context, topic, staleToken string) (bool, error)

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 (s *PgSQLStorage) RetrieveNextCommand(r *mdm.Request, skipNotNow bool) (*mdm.Command, error)

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 (s *PgSQLStorage) RetrieveTokenUpdateTally(ctx context.Context, id string) (int, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL