MCPcopy Create free account
hub / github.com/PatchMon/PatchMon / GetByID

Method GetByID

server-source-code/internal/store/hosts.go:86–92  ·  view source on GitHub ↗

GetByID returns a host by ID.

(ctx context.Context, id string)

Source from the content-addressed store, hash-verified

84
85// GetByID returns a host by ID.
86func (s *HostsStore) GetByID(ctx context.Context, id string) (*models.Host, error) {
87 hosts, err := s.GetByIDs(ctx, []string{id})
88 if err != nil || len(hosts) == 0 {
89 return nil, err
90 }
91 return &hosts[0], nil
92}
93
94// GetByIDs returns hosts by IDs in one query. Preserves input order.
95func (s *HostsStore) GetByIDs(ctx context.Context, ids []string) ([]models.Host, error) {

Callers 1

GetHostDetailMethod · 0.95

Calls 1

GetByIDsMethod · 0.95

Tested by

no test coverage detected