api.spaceplanner.app

Spaceplanner API
git clone git://jacobedwards.org/api.spaceplanner.app
Log | Files | Refs

commit 907da057dcee96aa2e342a85d4ca602f1109ffdb
parent 0996a536ed4af01fe44fd426ccc13993e3dab3af
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Fri,  4 Oct 2024 11:27:18 -0700

Make backend's parseID public

It's now named ParseObjectID.

Diffstat:
Minternal/backend/floorplan_data.go | 2+-
Minternal/backend/id.go | 6+++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/internal/backend/floorplan_data.go b/internal/backend/floorplan_data.go @@ -764,7 +764,7 @@ func parsePath(p string) (ObjectID, error) { return ObjectID{}, errors.New(p + ": Object does not exist") } - id, err := parseID(parts[len(parts) - 1]) + id, err := ParseObjectID(parts[len(parts) - 1]) if err != nil { return ObjectID{}, err } diff --git a/internal/backend/id.go b/internal/backend/id.go @@ -33,7 +33,7 @@ func init() { } } -func parseID(s string) (ObjectID, error) { +func ParseObjectID(s string) (ObjectID, error) { a := strings.Split(s, "_") if len(a) != 2 { return ObjectID{}, errors.New(s + ": Invalid ID") @@ -81,7 +81,7 @@ func (id *ObjectID) UnmarshalJSON(b []byte) error { if err := json.Unmarshal(b, &s); err != nil { return err } - d, err := parseID(s) + d, err := ParseObjectID(s) *id = d return err } @@ -91,7 +91,7 @@ func (id ObjectID) MarshalText() ([]byte, error) { } func (id *ObjectID) UnmarshalText(b []byte) error { - d, err := parseID(string(b)) + d, err := ParseObjectID(string(b)) *id = d return err }