{"modulePath":"github.com/chainloop-dev/chainloop","version":"v0.97.7","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package misc\n\n## Functions\n\n```go\nfunc LoadJSONBytes(rawData []byte, extension string) ([]byte, error)\n```\nLoadJSONBytes Extracts raw data in JSON format from different sources, i.e cue or yaml files\n\n```go\nfunc UnmarshalFromRaw(body []byte, format RawFormat, out proto.Message) error\n```\n\n## Types\n\n```go\ntype RawFormat string\n```\n\n```go\nconst (\n\tRawFormatJSON RawFormat = \"json\"\n\tRawFormatYAML RawFormat = \"yaml\"\n\tRawFormatCUE  RawFormat = \"cue\"\n)\n```\n\n```go\nfunc IdentifyFormat(raw []byte) (RawFormat, error)\n```\nIdentifyFormat does best effort to identify the format of the raw contract by going the unmarshalling path in the following order: json, cue, yaml NOTE that we are just validating the format, not the content using regular marshalling not even proto marshalling, that comes later once we know the format\n\n```go\nfunc (RawFormat) Values() (kinds []string)\n```\nImplements [https://pkg.go.dev/entgo.io/ent/schema/field#EnumValues](https://pkg.go.dev/entgo.io/ent/schema/field#EnumValues)\n\n","path":"github.com/chainloop-dev/chainloop/app/controlplane/pkg/misc","name":"misc","synopsis":"","isRedistributable":true}
