Compare commits
2 Commits
537ee53384
...
608f05d395
Author | SHA1 | Date | |
---|---|---|---|
608f05d395 | |||
b5420f9dbd |
@ -4,6 +4,15 @@ set -euo pipefail
|
||||
|
||||
go install github.com/goreleaser/goreleaser@v1.22.1
|
||||
|
||||
if [ ! -z "$harbor_username"]; then
|
||||
DOCKER_FILE=~/.docker/config.json
|
||||
if [ ! -e $DOCKER_FILE ]; then
|
||||
mkdir -p ~/.docker/
|
||||
export harbor_auth=`cat /dev/null | jq -s -r '[ env.harbor_username, env.harbor_password ] | join(":") | @base64'`
|
||||
echo '{"auths":{"harbor.ntppool.org":{"auth":""}}}' | jq '.auths["harbor.ntppool.org"].auth=env.harbor_auth' > $DOCKER_FILE
|
||||
fi
|
||||
fi
|
||||
|
||||
DRONE_TAG=${DRONE_TAG-""}
|
||||
|
||||
is_snapshot=""
|
||||
|
52
types/log_scores.go
Normal file
52
types/log_scores.go
Normal file
@ -0,0 +1,52 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
)
|
||||
|
||||
type LogScoreAttributes struct {
|
||||
Leap int8 `json:"leap,omitempty"`
|
||||
Stratum int8 `json:"stratum,omitempty"`
|
||||
NoResponse bool `json:"no_response,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Warning string `json:"warning,omitempty"`
|
||||
|
||||
FromLSID int `json:"from_ls_id,omitempty"`
|
||||
FromSSID int `json:"from_ss_id,omitempty"`
|
||||
}
|
||||
|
||||
func (lsa *LogScoreAttributes) String() string {
|
||||
b, err := json.Marshal(lsa)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func (lsa *LogScoreAttributes) Value() (driver.Value, error) {
|
||||
return json.Marshal(lsa)
|
||||
}
|
||||
|
||||
func (lsa *LogScoreAttributes) Scan(value interface{}) error {
|
||||
var source []byte
|
||||
_t := LogScoreAttributes{}
|
||||
|
||||
switch v := value.(type) {
|
||||
case []uint8:
|
||||
source = v
|
||||
case string:
|
||||
source = []byte(v)
|
||||
case nil:
|
||||
return nil
|
||||
default:
|
||||
return errors.New("incompatible type for StringInterfaceMap")
|
||||
}
|
||||
err := json.Unmarshal(source, &_t)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*lsa = _t
|
||||
return nil
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user