group.go 526 B

1234567891011121314151617181920212223242526272829303132333435
  1. package models
  2. import (
  3. "github.com/gocarina/gocsv"
  4. )
  5. type Group struct {
  6. Meta
  7. Name string
  8. Participants []*Participant
  9. }
  10. func (g *Group) String() string {
  11. return g.Name
  12. }
  13. func (g *Group) GetID() string {
  14. return g.ID
  15. }
  16. func (g *Group) SetID(id string) {
  17. g.ID = id
  18. }
  19. func (g *Group) GetHash() string {
  20. return ""
  21. }
  22. func (g *Group) Marshal() ([]byte, error) {
  23. return gocsv.MarshalBytes(g.Participants)
  24. }
  25. func (g *Group) Unmarshal(data []byte) error {
  26. return gocsv.UnmarshalBytes(data, &g.Participants)
  27. }