MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / Set

Method Set

lib/raft/slave.go:103–109  ·  view source on GitHub ↗
(ctx context.Context, in *proto.SlaveSetRequest)

Source from the content-addressed store, hash-verified

101}
102
103func (s *Slave) Set(ctx context.Context, in *proto.SlaveSetRequest) (*proto.SlaveSetResponse, error) {
104 err := s.DB.Put([]byte(in.Key), []byte(in.Value))
105 if err != nil {
106 return &proto.SlaveSetResponse{}, err
107 }
108 return &proto.SlaveSetResponse{Ok: true}, nil
109}
110
111func (s *Slave) Del(ctx context.Context, in *proto.SlaveDelRequest) (*proto.SlaveDelResponse, error) {
112 err := s.DB.Delete([]byte(in.Key))

Callers

nothing calls this directly

Calls 1

PutMethod · 0.65

Tested by

no test coverage detected