mysql

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 10 Imported by: 1

Documentation

Overview

Pacakge mysql stores and retrieves MDM data from SQL

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCert = errors.New("no certificate in MDM Request")

Functions

This section is empty.

Types

type MySQLStorage

type MySQLStorage struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*MySQLStorage, error)

func (*MySQLStorage) AssociateCertHash

func (s *MySQLStorage) AssociateCertHash(r *mdm.Request, hash string) error

func (*MySQLStorage) ClearQueue

func (s *MySQLStorage) ClearQueue(r *mdm.Request) error

func (*MySQLStorage) Disable

func (s *MySQLStorage) Disable(r *mdm.Request) error

func (*MySQLStorage) EnqueueCommand

func (m *MySQLStorage) EnqueueCommand(ctx context.Context, ids []string, cmd *mdm.Command) (map[string]error, error)

func (*MySQLStorage) EnrollmentHasCertHash

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

func (*MySQLStorage) HasCertHash

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

func (*MySQLStorage) IsCertHashAssociated

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

func (*MySQLStorage) IsPushCertStale

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

func (*MySQLStorage) RetrieveBootstrapToken

func (s *MySQLStorage) RetrieveBootstrapToken(r *mdm.Request, _ *mdm.GetBootstrapToken) (*mdm.BootstrapToken, error)

func (*MySQLStorage) RetrieveMigrationCheckins

func (s *MySQLStorage) RetrieveMigrationCheckins(ctx context.Context, c chan<- interface{}) error

func (*MySQLStorage) RetrieveNextCommand

func (s *MySQLStorage) RetrieveNextCommand(r *mdm.Request, skipNotNow bool) (*mdm.Command, error)

func (*MySQLStorage) RetrievePushCert

func (s *MySQLStorage) RetrievePushCert(ctx context.Context, topic string) (*tls.Certificate, string, error)

func (*MySQLStorage) RetrievePushInfo

func (s *MySQLStorage) 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 (*MySQLStorage) RetrieveTokenUpdateTally

func (s *MySQLStorage) RetrieveTokenUpdateTally(ctx context.Context, id string) (int, error)

func (*MySQLStorage) StoreAuthenticate

func (s *MySQLStorage) StoreAuthenticate(r *mdm.Request, msg *mdm.Authenticate) error

func (*MySQLStorage) StoreBootstrapToken

func (s *MySQLStorage) StoreBootstrapToken(r *mdm.Request, msg *mdm.SetBootstrapToken) error

func (*MySQLStorage) StoreCommandReport

func (s *MySQLStorage) StoreCommandReport(r *mdm.Request, result *mdm.CommandResults) error

func (*MySQLStorage) StorePushCert

func (s *MySQLStorage) StorePushCert(ctx context.Context, pemCert, pemKey []byte) error

func (*MySQLStorage) StoreTokenUpdate

func (s *MySQLStorage) StoreTokenUpdate(r *mdm.Request, msg *mdm.TokenUpdate) error

func (*MySQLStorage) StoreUserAuthenticate

func (s *MySQLStorage) StoreUserAuthenticate(r *mdm.Request, msg *mdm.UserAuthenticate) error

type Option

type Option func(*config)

func WithDB

func WithDB(db *sql.DB) Option

func WithDSN

func WithDSN(dsn string) Option

func WithDriver

func WithDriver(driver string) Option

func WithLogger

func WithLogger(logger log.Logger) Option

Jump to

Keyboard shortcuts

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