this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cue/encoding: removed unused package.

Change-Id: I3e9e2f2a4c872ccde69f47d1a58879bc4c4ff824
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/9383
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>

-58
-58
cue/encoding/encoding.go
··· 1 - // Copyright 2018 The CUE Authors 2 - // 3 - // Licensed under the Apache License, Version 2.0 (the "License"); 4 - // you may not use this file except in compliance with the License. 5 - // You may obtain a copy of the License at 6 - // 7 - // http://www.apache.org/licenses/LICENSE-2.0 8 - // 9 - // Unless required by applicable law or agreed to in writing, software 10 - // distributed under the License is distributed on an "AS IS" BASIS, 11 - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 - // See the License for the specific language governing permissions and 13 - // limitations under the License. 14 - 15 - // Package encoding provides support for managing data format files supported 16 - // by CUE. 17 - package encoding // import "cuelang.org/go/cue/encoding" 18 - 19 - import "strings" 20 - 21 - // Encoding represents a data encoding. 22 - type Encoding struct { 23 - name string 24 - } 25 - 26 - // Name returns a lowercase name of an encoding. This is conventionally the most 27 - // common file extension in lower case. 28 - func (e *Encoding) Name() string { 29 - return e.name 30 - } 31 - 32 - // All returns all known encodings. 33 - func All() []*Encoding { 34 - return []*Encoding{jsonEnc, yamlEnc, protodefEnc} 35 - } 36 - 37 - // MapExtension returns the likely encoding for a given file extension. 38 - func MapExtension(ext string) *Encoding { 39 - return extensions[strings.ToLower(ext)] 40 - } 41 - 42 - var ( 43 - cueEnc = &Encoding{name: "cue"} 44 - jsonEnc = &Encoding{name: "json"} 45 - yamlEnc = &Encoding{name: "yaml"} 46 - protodefEnc = &Encoding{name: "protobuf"} 47 - ) 48 - 49 - // extensions maps a file extension to a Kind. 50 - var extensions = map[string]*Encoding{ 51 - ".cue": cueEnc, 52 - ".json": jsonEnc, 53 - ".jsonl": jsonEnc, 54 - ".ndjson": jsonEnc, 55 - ".yaml": yamlEnc, 56 - ".yml": yamlEnc, 57 - ".proto": protodefEnc, 58 - }