package service import ( "bytes" "git.server.ky/slackcoder/mirror/internal" "github.com/BurntSushi/toml" ) type Mirror struct { Method string `toml:"method,omitempty"` From *internal.URL `toml:"from,omitempty"` To *internal.URL `toml:"to,omitempty"` Description string `toml:"description,omitempty"` } func (m *Mirror) Equal(arg *Mirror) bool { return m.Method == arg.Method && m.From.String() == arg.From.String() && m.To.String() == arg.To.String() } func (m *Mirror) String() string { var buf bytes.Buffer toml.NewEncoder(&buf).Encode(m) return buf.String() }