@ -26,6 +26,36 @@ func ___encode(i interface{}) ([]byte, error) {
// encodeAsArray
func ___encodeAsArray ( i interface { } ) ( [ ] byte , error ) {
switch v := i . ( type ) {
case HealthCommand :
encoder := enc . NewEncoder ( )
size , err := ___calcArraySizeHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , encoder )
if err != nil {
return nil , err
}
encoder . MakeBytes ( size )
b , offset , err := ___encodeArrayHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , encoder , 0 )
if err != nil {
return nil , err
}
if size != offset {
return nil , fmt . Errorf ( "%s size / offset different %d : %d" , "HealthCommand" , size , offset )
}
return b , err
case * HealthCommand :
encoder := enc . NewEncoder ( )
size , err := ___calcArraySizeHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( * v , encoder )
if err != nil {
return nil , err
}
encoder . MakeBytes ( size )
b , offset , err := ___encodeArrayHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( * v , encoder , 0 )
if err != nil {
return nil , err
}
if size != offset {
return nil , fmt . Errorf ( "%s size / offset different %d : %d" , "HealthCommand" , size , offset )
}
return b , err
case HealthInfo :
encoder := enc . NewEncoder ( )
size , err := ___calcArraySizeHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , encoder )
@ -86,6 +116,36 @@ func ___encodeAsArray(i interface{}) ([]byte, error) {
return nil , fmt . Errorf ( "%s size / offset different %d : %d" , "HealthResponse" , size , offset )
}
return b , err
case FetchCRLResponse :
encoder := enc . NewEncoder ( )
size , err := ___calcArraySizeFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , encoder )
if err != nil {
return nil , err
}
encoder . MakeBytes ( size )
b , offset , err := ___encodeArrayFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , encoder , 0 )
if err != nil {
return nil , err
}
if size != offset {
return nil , fmt . Errorf ( "%s size / offset different %d : %d" , "FetchCRLResponse" , size , offset )
}
return b , err
case * FetchCRLResponse :
encoder := enc . NewEncoder ( )
size , err := ___calcArraySizeFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( * v , encoder )
if err != nil {
return nil , err
}
encoder . MakeBytes ( size )
b , offset , err := ___encodeArrayFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( * v , encoder , 0 )
if err != nil {
return nil , err
}
if size != offset {
return nil , fmt . Errorf ( "%s size / offset different %d : %d" , "FetchCRLResponse" , size , offset )
}
return b , err
case ErrorResponse :
encoder := enc . NewEncoder ( )
size , err := ___calcArraySizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , encoder )
@ -123,6 +183,36 @@ func ___encodeAsArray(i interface{}) ([]byte, error) {
// encodeAsMap
func ___encodeAsMap ( i interface { } ) ( [ ] byte , error ) {
switch v := i . ( type ) {
case HealthCommand :
encoder := enc . NewEncoder ( )
size , err := ___calcMapSizeHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , encoder )
if err != nil {
return nil , err
}
encoder . MakeBytes ( size )
b , offset , err := ___encodeMapHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , encoder , 0 )
if err != nil {
return nil , err
}
if size != offset {
return nil , fmt . Errorf ( "%s size / offset different %d : %d" , "HealthCommand" , size , offset )
}
return b , err
case * HealthCommand :
encoder := enc . NewEncoder ( )
size , err := ___calcMapSizeHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( * v , encoder )
if err != nil {
return nil , err
}
encoder . MakeBytes ( size )
b , offset , err := ___encodeMapHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( * v , encoder , 0 )
if err != nil {
return nil , err
}
if size != offset {
return nil , fmt . Errorf ( "%s size / offset different %d : %d" , "HealthCommand" , size , offset )
}
return b , err
case HealthInfo :
encoder := enc . NewEncoder ( )
size , err := ___calcMapSizeHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , encoder )
@ -183,6 +273,36 @@ func ___encodeAsMap(i interface{}) ([]byte, error) {
return nil , fmt . Errorf ( "%s size / offset different %d : %d" , "HealthResponse" , size , offset )
}
return b , err
case FetchCRLResponse :
encoder := enc . NewEncoder ( )
size , err := ___calcMapSizeFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , encoder )
if err != nil {
return nil , err
}
encoder . MakeBytes ( size )
b , offset , err := ___encodeMapFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , encoder , 0 )
if err != nil {
return nil , err
}
if size != offset {
return nil , fmt . Errorf ( "%s size / offset different %d : %d" , "FetchCRLResponse" , size , offset )
}
return b , err
case * FetchCRLResponse :
encoder := enc . NewEncoder ( )
size , err := ___calcMapSizeFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( * v , encoder )
if err != nil {
return nil , err
}
encoder . MakeBytes ( size )
b , offset , err := ___encodeMapFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( * v , encoder , 0 )
if err != nil {
return nil , err
}
if size != offset {
return nil , fmt . Errorf ( "%s size / offset different %d : %d" , "FetchCRLResponse" , size , offset )
}
return b , err
case ErrorResponse :
encoder := enc . NewEncoder ( )
size , err := ___calcMapSizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , encoder )
@ -229,6 +349,20 @@ func ___decode(data []byte, i interface{}) (bool, error) {
// decodeAsArray
func ___decodeAsArray ( data [ ] byte , i interface { } ) ( bool , error ) {
switch v := i . ( type ) {
case * HealthCommand :
decoder := dec . NewDecoder ( data )
offset , err := ___decodeArrayHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , decoder , 0 )
if err == nil && offset != decoder . Len ( ) {
return true , fmt . Errorf ( "read length is different [%d] [%d] " , offset , decoder . Len ( ) )
}
return true , err
case * * HealthCommand :
decoder := dec . NewDecoder ( data )
offset , err := ___decodeArrayHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( * v , decoder , 0 )
if err == nil && offset != decoder . Len ( ) {
return true , fmt . Errorf ( "read length is different [%d] [%d] " , offset , decoder . Len ( ) )
}
return true , err
case * HealthInfo :
decoder := dec . NewDecoder ( data )
offset , err := ___decodeArrayHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , decoder , 0 )
@ -257,6 +391,20 @@ func ___decodeAsArray(data []byte, i interface{}) (bool, error) {
return true , fmt . Errorf ( "read length is different [%d] [%d] " , offset , decoder . Len ( ) )
}
return true , err
case * FetchCRLResponse :
decoder := dec . NewDecoder ( data )
offset , err := ___decodeArrayFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , decoder , 0 )
if err == nil && offset != decoder . Len ( ) {
return true , fmt . Errorf ( "read length is different [%d] [%d] " , offset , decoder . Len ( ) )
}
return true , err
case * * FetchCRLResponse :
decoder := dec . NewDecoder ( data )
offset , err := ___decodeArrayFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( * v , decoder , 0 )
if err == nil && offset != decoder . Len ( ) {
return true , fmt . Errorf ( "read length is different [%d] [%d] " , offset , decoder . Len ( ) )
}
return true , err
case * ErrorResponse :
decoder := dec . NewDecoder ( data )
offset , err := ___decodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , decoder , 0 )
@ -278,6 +426,20 @@ func ___decodeAsArray(data []byte, i interface{}) (bool, error) {
// decodeAsMap
func ___decodeAsMap ( data [ ] byte , i interface { } ) ( bool , error ) {
switch v := i . ( type ) {
case * HealthCommand :
decoder := dec . NewDecoder ( data )
offset , err := ___decodeMapHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , decoder , 0 )
if err == nil && offset != decoder . Len ( ) {
return true , fmt . Errorf ( "read length is different [%d] [%d] " , offset , decoder . Len ( ) )
}
return true , err
case * * HealthCommand :
decoder := dec . NewDecoder ( data )
offset , err := ___decodeMapHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( * v , decoder , 0 )
if err == nil && offset != decoder . Len ( ) {
return true , fmt . Errorf ( "read length is different [%d] [%d] " , offset , decoder . Len ( ) )
}
return true , err
case * HealthInfo :
decoder := dec . NewDecoder ( data )
offset , err := ___decodeMapHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , decoder , 0 )
@ -306,6 +468,20 @@ func ___decodeAsMap(data []byte, i interface{}) (bool, error) {
return true , fmt . Errorf ( "read length is different [%d] [%d] " , offset , decoder . Len ( ) )
}
return true , err
case * FetchCRLResponse :
decoder := dec . NewDecoder ( data )
offset , err := ___decodeMapFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , decoder , 0 )
if err == nil && offset != decoder . Len ( ) {
return true , fmt . Errorf ( "read length is different [%d] [%d] " , offset , decoder . Len ( ) )
}
return true , err
case * * FetchCRLResponse :
decoder := dec . NewDecoder ( data )
offset , err := ___decodeMapFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( * v , decoder , 0 )
if err == nil && offset != decoder . Len ( ) {
return true , fmt . Errorf ( "read length is different [%d] [%d] " , offset , decoder . Len ( ) )
}
return true , err
case * ErrorResponse :
decoder := dec . NewDecoder ( data )
offset , err := ___decodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v , decoder , 0 )
@ -324,6 +500,81 @@ func ___decodeAsMap(data []byte, i interface{}) (bool, error) {
return false , nil
}
// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.HealthCommand
func ___calcArraySizeHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v HealthCommand , encoder * enc . Encoder ) ( int , error ) {
size := 0
size += encoder . CalcStructHeaderFix ( 0 )
return size , nil
}
// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.HealthCommand
func ___calcMapSizeHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v HealthCommand , encoder * enc . Encoder ) ( int , error ) {
size := 0
size += encoder . CalcStructHeaderFix ( 0 )
return size , nil
}
// encode from git.cacert.org/cacert-gosigner/pkg/messages.HealthCommand
func ___encodeArrayHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v HealthCommand , encoder * enc . Encoder , offset int ) ( [ ] byte , int , error ) {
var err error
offset = encoder . WriteStructHeaderFixAsArray ( 0 , offset )
return encoder . EncodedBytes ( ) , offset , err
}
// encode from git.cacert.org/cacert-gosigner/pkg/messages.HealthCommand
func ___encodeMapHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v HealthCommand , encoder * enc . Encoder , offset int ) ( [ ] byte , int , error ) {
var err error
offset = encoder . WriteStructHeaderFixAsMap ( 0 , offset )
return encoder . EncodedBytes ( ) , offset , err
}
// decode to git.cacert.org/cacert-gosigner/pkg/messages.HealthCommand
func ___decodeArrayHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v * HealthCommand , decoder * dec . Decoder , offset int ) ( int , error ) {
offset , err := decoder . CheckStructHeader ( 0 , offset )
if err != nil {
return 0 , err
}
return offset , err
}
// decode to git.cacert.org/cacert-gosigner/pkg/messages.HealthCommand
func ___decodeMapHealthCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v * HealthCommand , decoder * dec . Decoder , offset int ) ( int , error ) {
keys := [ ] [ ] byte { }
offset , err := decoder . CheckStructHeader ( 0 , offset )
if err != nil {
return 0 , err
}
count := 0
for count < 0 {
var dataKey [ ] byte
dataKey , offset , err = decoder . AsStringBytes ( offset )
if err != nil {
return 0 , err
}
fieldIndex := - 1
for i , key := range keys {
if len ( dataKey ) != len ( key ) {
continue
}
fieldIndex = i
for dataKeyIndex := range dataKey {
if dataKey [ dataKeyIndex ] != key [ dataKeyIndex ] {
fieldIndex = - 1
break
}
}
if fieldIndex >= 0 {
break
}
}
switch fieldIndex {
default :
return 0 , fmt . Errorf ( "unknown key[%s] found" , string ( dataKey ) )
}
}
return offset , err
}
// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.HealthInfo
func ___calcArraySizeHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v HealthInfo , encoder * enc . Encoder ) ( int , error ) {
size := 0
@ -562,11 +813,16 @@ func ___calcArraySizeHealthResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81
}
size += s
for _ , vv := range v . Info {
size_vv , err := ___calcArraySizeHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( vv , encoder )
if vv != nil {
vvp := * vv
size_vvp , err := ___calcArraySizeHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( vvp , encoder )
if err != nil {
return 0 , err
}
size += size_vv
size += size_vvp
} else {
size += encoder . CalcNil ( )
}
}
} else {
size += encoder . CalcNil ( )
@ -590,11 +846,16 @@ func ___calcMapSizeHealthResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a8137
}
size += s
for _ , vv := range v . Info {
size_vv , err := ___calcMapSizeHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( vv , encoder )
if vv != nil {
vvp := * vv
size_vvp , err := ___calcMapSizeHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( vvp , encoder )
if err != nil {
return 0 , err
}
size += size_vv
size += size_vvp
} else {
size += encoder . CalcNil ( )
}
}
} else {
size += encoder . CalcNil ( )
@ -611,10 +872,15 @@ func ___encodeArrayHealthResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a8137
if v . Info != nil {
offset = encoder . WriteSliceLength ( len ( v . Info ) , offset , false )
for _ , vv := range v . Info {
_ , offset , err = ___encodeArrayHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( vv , encoder , offset )
if vv != nil {
vvp := * vv
_ , offset , err = ___encodeArrayHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( vvp , encoder , offset )
if err != nil {
return nil , 0 , err
}
} else {
offset = encoder . WriteNil ( offset )
}
}
} else {
offset = encoder . WriteNil ( offset )
@ -628,16 +894,21 @@ func ___encodeMapHealthResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f
offset = encoder . WriteStructHeaderFixAsMap ( 3 , offset )
offset = encoder . WriteStringFix ( "version" , 7 , offset )
offset = encoder . WriteString ( v . Version , offset )
offset = encoder . WriteStringFix ( " H ealthy", 7 , offset )
offset = encoder . WriteStringFix ( " h ealthy", 7 , offset )
offset = encoder . WriteBool ( v . Healthy , offset )
offset = encoder . WriteStringFix ( "Info" , 4 , offset )
if v . Info != nil {
offset = encoder . WriteSliceLength ( len ( v . Info ) , offset , false )
for _ , vv := range v . Info {
_ , offset , err = ___encodeMapHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( vv , encoder , offset )
if vv != nil {
vvp := * vv
_ , offset , err = ___encodeMapHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( vvp , encoder , offset )
if err != nil {
return nil , 0 , err
}
} else {
offset = encoder . WriteNil ( offset )
}
}
} else {
offset = encoder . WriteNil ( offset )
@ -668,19 +939,25 @@ func ___decodeArrayHealthResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a8137
v . Healthy = vv
}
if ! decoder . IsCodeNil ( offset ) {
var vv [ ] HealthInfo
var vv [ ] * HealthInfo
var vvl int
vvl , offset , err = decoder . SliceLength ( offset )
if err != nil {
return 0 , err
}
vv = make ( [ ] HealthInfo , vvl )
vv = make ( [ ] * HealthInfo , vvl )
for vvi := range vv {
var vvv HealthInfo
offset , err = ___decodeArrayHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( & vvv , decoder , offset )
var vvv * HealthInfo
if ! decoder . IsCodeNil ( offset ) {
var vvvp HealthInfo
offset , err = ___decodeArrayHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( & vvvp , decoder , offset )
if err != nil {
return 0 , err
}
vvv = & vvvp
} else {
offset ++
}
vv [ vvi ] = vvv
}
v . Info = vv
@ -694,7 +971,7 @@ func ___decodeArrayHealthResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a8137
func ___decodeMapHealthResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v * HealthResponse , decoder * dec . Decoder , offset int ) ( int , error ) {
keys := [ ] [ ] byte {
{ uint8 ( 0x76 ) , uint8 ( 0x65 ) , uint8 ( 0x72 ) , uint8 ( 0x73 ) , uint8 ( 0x69 ) , uint8 ( 0x6f ) , uint8 ( 0x6e ) } , // version
{ uint8 ( 0x 4 8) , uint8 ( 0x65 ) , uint8 ( 0x61 ) , uint8 ( 0x6c ) , uint8 ( 0x74 ) , uint8 ( 0x68 ) , uint8 ( 0x79 ) } , // H ealthy
{ uint8 ( 0x 6 8) , uint8 ( 0x65 ) , uint8 ( 0x61 ) , uint8 ( 0x6c ) , uint8 ( 0x74 ) , uint8 ( 0x68 ) , uint8 ( 0x79 ) } , // h ealthy
{ uint8 ( 0x49 ) , uint8 ( 0x6e ) , uint8 ( 0x66 ) , uint8 ( 0x6f ) } , // Info
}
offset , err := decoder . CheckStructHeader ( 3 , offset )
@ -747,19 +1024,25 @@ func ___decodeMapHealthResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f
count ++
case 2 :
if ! decoder . IsCodeNil ( offset ) {
var vv [ ] HealthInfo
var vv [ ] * HealthInfo
var vvl int
vvl , offset , err = decoder . SliceLength ( offset )
if err != nil {
return 0 , err
}
vv = make ( [ ] HealthInfo , vvl )
vv = make ( [ ] * HealthInfo , vvl )
for vvi := range vv {
var vvv HealthInfo
offset , err = ___decodeMapHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( & vvv , decoder , offset )
var vvv * HealthInfo
if ! decoder . IsCodeNil ( offset ) {
var vvvp HealthInfo
offset , err = ___decodeMapHealthInfo_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( & vvvp , decoder , offset )
if err != nil {
return 0 , err
}
vvv = & vvvp
} else {
offset ++
}
vv [ vvi ] = vvv
}
v . Info = vv
@ -774,6 +1057,217 @@ func ___decodeMapHealthResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f
return offset , err
}
// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.FetchCRLResponse
func ___calcArraySizeFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v FetchCRLResponse , encoder * enc . Encoder ) ( int , error ) {
size := 0
size += encoder . CalcStructHeaderFix ( 3 )
size += encoder . CalcString ( v . IssuerID )
size += encoder . CalcBool ( v . IsDelta )
if v . CRLData != nil {
s , err := encoder . CalcSliceLength ( len ( v . CRLData ) , true )
if err != nil {
return 0 , err
}
size += s
for _ , vv := range v . CRLData {
size += encoder . CalcByte ( vv )
}
} else {
size += encoder . CalcNil ( )
}
return size , nil
}
// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.FetchCRLResponse
func ___calcMapSizeFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v FetchCRLResponse , encoder * enc . Encoder ) ( int , error ) {
size := 0
size += encoder . CalcStructHeaderFix ( 3 )
size += encoder . CalcStringFix ( 9 )
size += encoder . CalcString ( v . IssuerID )
size += encoder . CalcStringFix ( 8 )
size += encoder . CalcBool ( v . IsDelta )
size += encoder . CalcStringFix ( 8 )
if v . CRLData != nil {
s , err := encoder . CalcSliceLength ( len ( v . CRLData ) , true )
if err != nil {
return 0 , err
}
size += s
for _ , vv := range v . CRLData {
size += encoder . CalcByte ( vv )
}
} else {
size += encoder . CalcNil ( )
}
return size , nil
}
// encode from git.cacert.org/cacert-gosigner/pkg/messages.FetchCRLResponse
func ___encodeArrayFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v FetchCRLResponse , encoder * enc . Encoder , offset int ) ( [ ] byte , int , error ) {
var err error
offset = encoder . WriteStructHeaderFixAsArray ( 3 , offset )
offset = encoder . WriteString ( v . IssuerID , offset )
offset = encoder . WriteBool ( v . IsDelta , offset )
if v . CRLData != nil {
offset = encoder . WriteSliceLength ( len ( v . CRLData ) , offset , true )
for _ , vv := range v . CRLData {
offset = encoder . WriteByte ( vv , offset )
}
} else {
offset = encoder . WriteNil ( offset )
}
return encoder . EncodedBytes ( ) , offset , err
}
// encode from git.cacert.org/cacert-gosigner/pkg/messages.FetchCRLResponse
func ___encodeMapFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v FetchCRLResponse , encoder * enc . Encoder , offset int ) ( [ ] byte , int , error ) {
var err error
offset = encoder . WriteStructHeaderFixAsMap ( 3 , offset )
offset = encoder . WriteStringFix ( "issuer_id" , 9 , offset )
offset = encoder . WriteString ( v . IssuerID , offset )
offset = encoder . WriteStringFix ( "is_delta" , 8 , offset )
offset = encoder . WriteBool ( v . IsDelta , offset )
offset = encoder . WriteStringFix ( "crl_data" , 8 , offset )
if v . CRLData != nil {
offset = encoder . WriteSliceLength ( len ( v . CRLData ) , offset , true )
for _ , vv := range v . CRLData {
offset = encoder . WriteByte ( vv , offset )
}
} else {
offset = encoder . WriteNil ( offset )
}
return encoder . EncodedBytes ( ) , offset , err
}
// decode to git.cacert.org/cacert-gosigner/pkg/messages.FetchCRLResponse
func ___decodeArrayFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v * FetchCRLResponse , decoder * dec . Decoder , offset int ) ( int , error ) {
offset , err := decoder . CheckStructHeader ( 3 , offset )
if err != nil {
return 0 , err
}
{
var vv string
vv , offset , err = decoder . AsString ( offset )
if err != nil {
return 0 , err
}
v . IssuerID = vv
}
{
var vv bool
vv , offset , err = decoder . AsBool ( offset )
if err != nil {
return 0 , err
}
v . IsDelta = vv
}
if ! decoder . IsCodeNil ( offset ) {
var vv [ ] byte
var vvl int
vvl , offset , err = decoder . SliceLength ( offset )
if err != nil {
return 0 , err
}
vv = make ( [ ] byte , vvl )
for vvi := range vv {
var vvv byte
vvv , offset , err = decoder . AsByte ( offset )
if err != nil {
return 0 , err
}
vv [ vvi ] = vvv
}
v . CRLData = vv
} else {
offset ++
}
return offset , err
}
// decode to git.cacert.org/cacert-gosigner/pkg/messages.FetchCRLResponse
func ___decodeMapFetchCRLResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v * FetchCRLResponse , decoder * dec . Decoder , offset int ) ( int , error ) {
keys := [ ] [ ] byte {
{ uint8 ( 0x69 ) , uint8 ( 0x73 ) , uint8 ( 0x73 ) , uint8 ( 0x75 ) , uint8 ( 0x65 ) , uint8 ( 0x72 ) , uint8 ( 0x5f ) , uint8 ( 0x69 ) , uint8 ( 0x64 ) } , // issuer_id
{ uint8 ( 0x69 ) , uint8 ( 0x73 ) , uint8 ( 0x5f ) , uint8 ( 0x64 ) , uint8 ( 0x65 ) , uint8 ( 0x6c ) , uint8 ( 0x74 ) , uint8 ( 0x61 ) } , // is_delta
{ uint8 ( 0x63 ) , uint8 ( 0x72 ) , uint8 ( 0x6c ) , uint8 ( 0x5f ) , uint8 ( 0x64 ) , uint8 ( 0x61 ) , uint8 ( 0x74 ) , uint8 ( 0x61 ) } , // crl_data
}
offset , err := decoder . CheckStructHeader ( 3 , offset )
if err != nil {
return 0 , err
}
count := 0
for count < 3 {
var dataKey [ ] byte
dataKey , offset , err = decoder . AsStringBytes ( offset )
if err != nil {
return 0 , err
}
fieldIndex := - 1
for i , key := range keys {
if len ( dataKey ) != len ( key ) {
continue
}
fieldIndex = i
for dataKeyIndex := range dataKey {
if dataKey [ dataKeyIndex ] != key [ dataKeyIndex ] {
fieldIndex = - 1
break
}
}
if fieldIndex >= 0 {
break
}
}
switch fieldIndex {
case 0 :
{
var vv string
vv , offset , err = decoder . AsString ( offset )
if err != nil {
return 0 , err
}
v . IssuerID = vv
}
count ++
case 1 :
{
var vv bool
vv , offset , err = decoder . AsBool ( offset )
if err != nil {
return 0 , err
}
v . IsDelta = vv
}
count ++
case 2 :
if ! decoder . IsCodeNil ( offset ) {
var vv [ ] byte
var vvl int
vvl , offset , err = decoder . SliceLength ( offset )
if err != nil {
return 0 , err
}
vv = make ( [ ] byte , vvl )
for vvi := range vv {
var vvv byte
vvv , offset , err = decoder . AsByte ( offset )
if err != nil {
return 0 , err
}
vv [ vvi ] = vvv
}
v . CRLData = vv
} else {
offset ++
}
count ++
default :
return 0 , fmt . Errorf ( "unknown key[%s] found" , string ( dataKey ) )
}
}
return offset , err
}
// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse
func ___calcArraySizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d ( v ErrorResponse , encoder * enc . Encoder ) ( int , error ) {
size := 0