blob: 460dd5e4d6ceaaf07d795c4a062182e6a2d9cc8a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package main
import (
"crypto/sha1"
"encoding/base64"
)
type DummyBackend struct{}
func (dummy *DummyBackend) Play(song *Song, player *Player) {
}
func (dummy *DummyBackend) Search(keyword string) []Song {
s := NewDummySong("Dummy Mc Crashtest", "exactly "+keyword)
return []Song{s}
}
func NewDummySong(title, artist string) Song {
h := sha1.New()
h.Write([]byte(title))
h.Write([]byte(artist))
return NewSong(title, artist, "dummy", base64.URLEncoding.EncodeToString(h.Sum(nil)))
}
|