From 667ecadd30286d400eeea634a678e47406abf468 Mon Sep 17 00:00:00 2001 From: Pavel Sviderski Date: Mon, 30 Sep 2024 20:46:41 +1000 Subject: [PATCH] init cluster store backed by corrosion --- internal/machine/store/store.go | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/internal/machine/store/store.go b/internal/machine/store/store.go index 719cec69..111121d8 100644 --- a/internal/machine/store/store.go +++ b/internal/machine/store/store.go @@ -1,6 +1,28 @@ package store -import _ "embed" +import ( + _ "embed" + "fmt" + "uncloud/internal/corrosion" + "uncloud/internal/machine/api/pb" +) //go:embed schema.sql var Schema string + +// Store is a cluster store backed by a distributed Corrosion database. +type Store struct { + corro *corrosion.APIClient +} + +func New(corro *corrosion.APIClient) *Store { + return &Store{corro: corro} +} + +func (s *Store) CreateMachine(machine *pb.MachineInfo) error { + return fmt.Errorf("not implemented") +} + +func (s *Store) ListMachines() ([]*pb.MachineInfo, error) { + return nil, fmt.Errorf("not implemented") +}