Skip to content

Commit

Permalink
Persistency
Browse files Browse the repository at this point in the history
  • Loading branch information
visill committed Aug 3, 2024
1 parent 9edf675 commit 0db4ebc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func listFunc(con net.Conn, instanceCnf *config.Instance, args []string) error {

switch tp {
case message.MessageTypeObjectMeta:
meta := message.ObjectMetaMessage{}
meta := message.ObjectInfoMessage{}
meta.Decode(body)

res = append(res, meta.Content...)
Expand Down
14 changes: 7 additions & 7 deletions pkg/message/object_meta_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import (
"github.com/yezzey-gp/yproxy/pkg/storage"
)

type ObjectMetaMessage struct {
type ObjectInfoMessage struct {
Content []*storage.ObjectInfo
}

var _ ProtoMessage = &ObjectMetaMessage{}
var _ ProtoMessage = &ObjectInfoMessage{}

func NewObjectMetaMessage(content []*storage.ObjectInfo) *ObjectMetaMessage {
return &ObjectMetaMessage{
func NewObjectMetaMessage(content []*storage.ObjectInfo) *ObjectInfoMessage {
return &ObjectInfoMessage{
Content: content,
}
}

func (c *ObjectMetaMessage) Encode() []byte {
func (c *ObjectInfoMessage) Encode() []byte {
bt := []byte{
byte(MessageTypeObjectMeta),
0,
Expand All @@ -42,7 +42,7 @@ func (c *ObjectMetaMessage) Encode() []byte {
return append(bs, bt...)
}

func (c *ObjectMetaMessage) Decode(body []byte) {
func (c *ObjectInfoMessage) Decode(body []byte) {
body = body[4:]
c.Content = make([]*storage.ObjectInfo, 0)
for len(body) > 0 {
Expand All @@ -57,7 +57,7 @@ func (c *ObjectMetaMessage) Decode(body []byte) {
}
}

func (c *ObjectMetaMessage) GetString(b []byte) (string, int) {
func (c *ObjectInfoMessage) GetString(b []byte) (string, int) {
buff := bytes.NewBufferString("")

i := 0
Expand Down

0 comments on commit 0db4ebc

Please sign in to comment.