MCPcopy
hub / github.com/grafana/tempo / FromVersionForWrites

Function FromVersionForWrites

tempodb/encoding/versioned.go:86–95  ·  view source on GitHub ↗

FromVersionForWrites returns a versioned encoding for the provided string, but only for encodings that are supported for creating new blocks. Deprecated or readonly encodings will return an error.

(v string)

Source from the content-addressed store, hash-verified

84// FromVersionForWrites returns a versioned encoding for the provided string, but only for
85// encodings that are supported for creating new blocks. Deprecated or readonly encodings will return an error.
86func FromVersionForWrites(v string) (VersionedEncoding, error) {
87 enc, err := FromVersion(v)
88 if err != nil {
89 return nil, err
90 }
91 if !enc.WritesSupported() {
92 return nil, fmt.Errorf("%s is not a valid block version for creating blocks", v)
93 }
94 return enc, nil
95}
96
97// DefaultEncoding for newly written blocks.
98func DefaultEncoding() VersionedEncoding {

Callers 7

validateConfigFunction · 0.92
ValidateMethod · 0.92
NewBlockMethod · 0.92
startingMethod · 0.92
NewFunction · 0.92
CoalesceVersionFunction · 0.85

Calls 2

FromVersionFunction · 0.85
WritesSupportedMethod · 0.65

Tested by

no test coverage detected