file

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package file is a filesystem-based storage backend for KMFDDM.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

File is a filesystem-based storage backend.

func New

func New(path string, newHash func() hash.Hash) (*File, error)

New creates and initializes a new filesystem-based storage backend.

func (*File) DeleteDeclaration

func (s *File) DeleteDeclaration(_ context.Context, identifier string) (bool, error)

DeleteDeclaration deletes a declaration by its ID. See also the storage package for documentation on the storage interfaces.

func (*File) RemoveEnrollmentSet

func (s *File) RemoveEnrollmentSet(_ context.Context, enrollmentID, setName string) (bool, error)

RemoveEnrollmentSet removes the association between an enrollment and a set. See also the storage package for documentation on the storage interfaces.

func (*File) RemoveSetDeclaration

func (s *File) RemoveSetDeclaration(_ context.Context, setName, declarationID string) (bool, error)

RemoveSetDeclaration removes the association between a declaration and a set.

func (*File) RetrieveDeclaration

func (s *File) RetrieveDeclaration(_ context.Context, declarationID string) (*ddm.Declaration, error)

RetrieveDeclaration retrieves a declaration by its ID. See also the storage package for documentation on the storage interfaces.

func (*File) RetrieveDeclarationItemsJSON

func (s *File) RetrieveDeclarationItemsJSON(_ context.Context, enrollmentID string) ([]byte, error)

RetrieveDeclarationItemsJSON retrieves the DDM declaration-items JSON for an enrollment ID.

func (*File) RetrieveDeclarationModTime added in v0.4.0

func (s *File) RetrieveDeclarationModTime(ctx context.Context, declarationID string) (time.Time, error)

RetrieveDeclarationModTime retrieves the last modification time of the declaration. See also the storage package for documentation on the storage interfaces.

func (*File) RetrieveDeclarationSets

func (s *File) RetrieveDeclarationSets(_ context.Context, declarationID string) ([]string, error)

RetrieveDeclarationSets returns the list of sets associated with a declaration. See also the storage package for documentation on the storage interfaces.

func (*File) RetrieveDeclarationStatus

func (s *File) RetrieveDeclarationStatus(_ context.Context, enrollmentIDs []string) (map[string][]ddm.DeclarationQueryStatus, error)

RetrieveDeclarationStatus retrieves the current status of declarations for the enrollment IDs. See also the storage package for documentation on the storage interfaces.

func (*File) RetrieveDeclarations

func (s *File) RetrieveDeclarations(_ context.Context) ([]string, error)

RetrieveDeclarations retrieves a slice of all declaration IDs. See also the storage package for documentation on the storage interfaces.

func (*File) RetrieveEnrollmentDeclarationJSON

func (s *File) RetrieveEnrollmentDeclarationJSON(_ context.Context, declarationID, declarationType, enrollmentID string) ([]byte, error)

RetrieveEnrollmentDeclarationJSON retrieves the DDM declaration JSON for an enrollment ID.

func (*File) RetrieveEnrollmentIDs added in v0.4.0

func (s *File) RetrieveEnrollmentIDs(_ context.Context, declarations []string, sets []string, ids []string) ([]string, error)

RetrieveEnrollmentIDs retrieves MDM enrollment IDs from storage. If a set, declaration, or enrollment ID doesn't exist it is ignored. See also the storage package for documentation on the storage interfaces.

func (*File) RetrieveEnrollmentSets

func (s *File) RetrieveEnrollmentSets(_ context.Context, enrollmentID string) ([]string, error)

RetrieveEnrollmentSets returns the slice of sets associated with an enrollment ID. See also the storage package for documentation on the storage interfaces.

func (*File) RetrieveSetDeclarations

func (s *File) RetrieveSetDeclarations(_ context.Context, setName string) ([]string, error)

RetrieveSetDeclarations returns a slice of declaration IDs that are associated with setName.

func (*File) RetrieveSets

func (s *File) RetrieveSets(_ context.Context) ([]string, error)

RetrieveSets retrieves the list of all sets. See also the storage package for documentation on the storage interfaces.

func (*File) RetrieveStatusErrors

func (s *File) RetrieveStatusErrors(_ context.Context, enrollmentIDs []string, offset, limit int) (map[string][]storage.StatusError, error)

RetrieveStatusErrors reads DDM errors from CSV file. See also the storage package for documentation on the storage interfaces.

func (*File) RetrieveStatusReport added in v0.4.0

func (s *File) RetrieveStatusReport(ctx context.Context, q storage.StatusReportQuery) (*storage.StoredStatusReport, error)

RetrieveStatusValues retrieves the status report for an enrollment ID. The file storage backend only supports saving a single (the last) status report. See also the storage package for documentation on the storage interfaces.

func (*File) RetrieveStatusValues

func (s *File) RetrieveStatusValues(_ context.Context, enrollmentIDs []string, pathPrefix string) (map[string][]storage.StatusValue, error)

RetrieveStatusValues returns the status values for the enrollment IDs. The search can be filtered with pathPrefix by using an SQL LIKE-like syntax. See also the storage package for documentation on the storage interfaces.

func (*File) RetrieveTokensJSON

func (s *File) RetrieveTokensJSON(_ context.Context, enrollmentID string) ([]byte, error)

RetrieveDeclarationItemsJSON retrieves the DDM token JSON for an enrollment ID.

func (*File) StoreDeclaration

func (s *File) StoreDeclaration(_ context.Context, d *ddm.Declaration) (bool, error)

StoreDeclaration stores a declaration on disk. See also the storage package for documentation on the storage interfaces.

func (*File) StoreDeclarationStatus

func (s *File) StoreDeclarationStatus(_ context.Context, enrollmentID string, status *ddm.StatusReport) error

StoreDeclarationStatus stores a status report from enrollmentID. See also the storage package for documentation on the storage interfaces.

func (*File) StoreEnrollmentSet

func (s *File) StoreEnrollmentSet(_ context.Context, enrollmentID, setName string) (bool, error)

StoreEnrollmentSet creates the association between an enrollment and a set. See also the storage package for documentation on the storage interfaces.

func (*File) StoreSetDeclaration

func (s *File) StoreSetDeclaration(_ context.Context, setName, declarationID string) (bool, error)

StoreSetDeclaration creates the association between a declaration and a set.

func (*File) TouchDeclaration added in v0.4.0

func (s *File) TouchDeclaration(ctx context.Context, declarationID string) error

TouchDeclaration rewrites a declaration with a new ServerToken. See also the storage package for documentation on the storage interfaces.

Jump to

Keyboard shortcuts

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