Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Pickett committed Aug 14, 2024
1 parent 50a4bda commit eaf4465
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/osquery/enrollment_details.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
"github.com/pkg/errors"
)

// getEnrollDetails returns an EnrollmentDetails struct with populated with details it can fetch without osquery.
// To get the rest of the details, pass the struct to getOsqEnrollDetails.
func getRuntimeEnrollDetails() service.EnrollmentDetails {
details := service.EnrollmentDetails{
OSPlatform: runtime.GOOS,
Expand Down Expand Up @@ -47,6 +49,8 @@ func getRuntimeEnrollDetails() service.EnrollmentDetails {
return details
}

// getOsqEnrollDetails queries osquery for enrollment details and populates the EnrollmentDetails struct.
// It's expected that the caller has initially populated the struct with runtimeEnrollDetails by calling getRuntimeEnrollDetails.
func getOsqEnrollDetails(ctx context.Context, osquerydPath string, details *service.EnrollmentDetails) error {
ctx, span := traces.StartSpan(ctx)
defer span.End()
Expand Down

0 comments on commit eaf4465

Please sign in to comment.