mirror of
https://github.com/Luzifer/badge-gen.git
synced 2024-11-08 13:20:02 +00:00
Add static badge plugin
This commit is contained in:
parent
ced8de83f9
commit
f14dfcdc87
1 changed files with 21 additions and 0 deletions
21
service_static.go
Normal file
21
service_static.go
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import "errors"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
registerServiceHandler("static", func(params []string) (title, text, color string, err error) {
|
||||||
|
if len(params) < 2 {
|
||||||
|
err = errors.New("You need to provide title and text")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(params) < 3 {
|
||||||
|
params = append(params, defaultColor)
|
||||||
|
}
|
||||||
|
|
||||||
|
title = params[0]
|
||||||
|
text = params[1]
|
||||||
|
color = params[2]
|
||||||
|
return
|
||||||
|
})
|
||||||
|
}
|
Loading…
Reference in a new issue