Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 42 for CBOR (0.16 sec)

  1. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/cbor.go

    	return obj, actual, strict
    }
    
    // selfDescribedCBOR is the CBOR encoding of the head of tag number 55799. This tag, specified in
    // RFC 8949 Section 3.4.6 "Self-Described CBOR", encloses all output from the encoder, has no
    // special semantics, and is used as a magic number to recognize CBOR-encoded data items.
    //
    // See https://www.rfc-editor.org/rfc/rfc8949.html#name-self-described-cbor.
    var selfDescribedCBOR = []byte{0xd9, 0xd9, 0xf7}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 13 14:57:12 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/encode.go

    */
    
    package modes
    
    import (
    	"github.com/fxamacker/cbor/v2"
    )
    
    var Encode cbor.EncMode = func() cbor.EncMode {
    	encode, err := cbor.EncOptions{
    		// Map keys need to be sorted to have deterministic output, and this is the order
    		// defined in RFC 8949 4.2.1 "Core Deterministic Encoding Requirements".
    		Sort: cbor.SortBytewiseLexical,
    
    		// CBOR supports distinct types for IEEE-754 float16, float32, and float64. Store
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Feb 15 15:31:10 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  3. pkg/api/testing/unstructured_test.go

    				if err != nil {
    					diag, _ := cbor.Diagnose(buf.Bytes())
    					t.Fatalf("error decoding cbor to unstructured: %v, diag: %s", err, diag)
    				}
    				if !apiequality.Semantic.DeepEqual(uCBOR, uCBOR2) {
    					t.Errorf("object changed during native-cbor-unstructured-cbor-unstructured roundtrip, diff: %s", cmp.Diff(uCBOR, uCBOR2))
    				}
    
    				// original->JSON/CBOR->Unstructured->JSON->final == original
    				buf.Reset()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:10 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode.go

    import (
    	"reflect"
    
    	"github.com/fxamacker/cbor/v2"
    )
    
    var Decode cbor.DecMode = func() cbor.DecMode {
    	decode, err := cbor.DecOptions{
    		// Maps with duplicate keys are well-formed but invalid according to the CBOR spec
    		// and never acceptable. Unlike the JSON serializer, inputs containing duplicate map
    		// keys are rejected outright and not surfaced as a strict decoding error.
    		DupMapKey: cbor.DupMapKeyEnforcedAPF,
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jun 10 14:03:36 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode_test.go

    	"k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes"
    
    	"github.com/fxamacker/cbor/v2"
    	"github.com/google/go-cmp/cmp"
    )
    
    func TestDecode(t *testing.T) {
    	hex := func(h string) []byte {
    		b, err := hex.DecodeString(h)
    		if err != nil {
    			t.Fatal(err)
    		}
    		return b
    	}
    
    	type test struct {
    		name          string
    		modes         []cbor.DecMode // most tests should run for all modes
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 22 18:43:10 UTC 2024
    - 25.6K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/modes_test.go

    import (
    	"errors"
    	"testing"
    
    	"github.com/fxamacker/cbor/v2"
    	"github.com/google/go-cmp/cmp"
    	"k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes"
    )
    
    var encModeNames = map[cbor.EncMode]string{
    	modes.Encode:                 "Encode",
    	modes.EncodeNondeterministic: "EncodeNondeterministic",
    }
    
    var allEncModes = []cbor.EncMode{
    	modes.Encode,
    	modes.EncodeNondeterministic,
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 22 18:43:10 UTC 2024
    - 2K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/diagnostic.go

    See the License for the specific language governing permissions and
    limitations under the License.
    */
    
    package modes
    
    import (
    	"github.com/fxamacker/cbor/v2"
    )
    
    var Diagnostic cbor.DiagMode = func() cbor.DiagMode {
    	opts := Decode.DecOptions()
    	diagnostic, err := cbor.DiagOptions{
    		ByteStringText: true,
    
    		MaxNestedLevels:  opts.MaxNestedLevels,
    		MaxArrayElements: opts.MaxArrayElements,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Feb 15 15:31:10 UTC 2024
    - 969 bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct/direct.go

    // Package direct provides functions for marshaling and unmarshaling between arbitrary Go values and
    // CBOR data, with behavior that is compatible with that of the CBOR serializer. In particular,
    // types that implement cbor.Marshaler and cbor.Unmarshaler should use these functions.
    package direct
    
    import (
    	"k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes"
    )
    
    func Marshal(src interface{}) ([]byte, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Feb 15 15:31:10 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_test.go

    		var initial, final MicroTime
    		fuzzer.Fuzz(&initial)
    		b, err := cbor.Marshal(initial)
    		if err != nil {
    			t.Errorf("error encoding %v: %v", initial, err)
    			continue
    		}
    		err = cbor.Unmarshal(b, &final)
    		if err != nil {
    			t.Errorf("%v: error decoding %v: %v", initial, string(b), err)
    		}
    		if !final.Equal(&initial) {
    			diag, err := cbor.Diagnose(b)
    			if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:10 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time_test.go

    		var initial, final Time
    		fuzzer.Fuzz(&initial)
    		b, err := cbor.Marshal(initial)
    		if err != nil {
    			t.Errorf("error encoding %v: %v", initial, err)
    			continue
    		}
    		err = cbor.Unmarshal(b, &final)
    		if err != nil {
    			t.Errorf("%v: error decoding %v: %v", initial, string(b), err)
    		}
    		if !final.Equal(&initial) {
    			diag, err := cbor.Diagnose(b)
    			if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:09 UTC 2024
    - 9.4K bytes
    - Viewed (0)
Back to top