github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/protocol/v2/v2.go (about) 1 // Copyright (c) 2022, R.I. Pienaar and the Choria Project contributors 2 // 3 // SPDX-License-Identifier: Apache-2.0 4 5 package v2 6 7 import ( 8 "errors" 9 10 "github.com/choria-io/go-choria/protocol/stats" 11 ) 12 13 const promVersion = "2" 14 15 var ( 16 ErrInvalidJSON = errors.New("supplied JSON document does not pass schema validation") 17 protocolErrorCtr = stats.ProtocolErrorCtr.WithLabelValues(promVersion) 18 invalidCtr = stats.InvalidCtr.WithLabelValues(promVersion) 19 validCtr = stats.ValidCtr.WithLabelValues(promVersion) 20 badJsonCtr = stats.BadJsonCtr.WithLabelValues(promVersion) 21 )