1 // Copyright 2020 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 cue is the main API for CUE evaluation. 16 // 17 // [Value] is the main type that represents CUE evaluations. 18 // Values are created with a [cuecontext.Context]. 19 // Only values created from the same Context can be involved in the same operation. 20 // Values created from the same Context are not safe for concurrent use, 21 // which we intend to change in the future. 22 // 23 // A Context defines the set of active packages, the translations of field 24 // names to unique codes, as well as the set of builtins. Use 25 // 26 // import "cuelang.org/go/cue/cuecontext" 27 // 28 // ctx := cuecontext.New() 29 // 30 // to obtain a context. 31 // 32 // Note that the following types are DEPRECATED and their usage should be 33 // avoided if possible: 34 // 35 // [FieldInfo] 36 // [Instance] 37 // [Runtime] 38 // [Struct] 39 // 40 // Many types also have deprecated methods. Code that already uses deprecated 41 // methods can keep using them for at least some time. We aim to provide a 42 // go or cue fix solution to automatically rewrite code using the new API. 43 package cue 44