probo/pkg/models/group.go

28 lines
428 B
Go
Raw Normal View History

package models
2023-11-21 15:12:13 +01:00
import (
"github.com/gocarina/gocsv"
)
type Group struct {
2023-11-21 15:12:13 +01:00
Meta
Name string
Participants []*Participant
}
2023-11-21 15:12:13 +01:00
func (g *Group) String() string {
return g.Name
}
func (g *Group) GetHash() string {
return ""
}
func (g *Group) Marshal() ([]byte, error) {
return gocsv.MarshalBytes(g.Participants)
}
func (g *Group) Unmarshal(data []byte) error {
2023-11-21 18:24:10 +01:00
return gocsv.UnmarshalBytes(data, &g.Participants)
2023-11-21 15:12:13 +01:00
}