1package key
2
3import (
4	"go.opentelemetry.io/otel/api/core"
5)
6
7// New creates a new key with a passed name.
8func New(name string) core.Key {
9	return core.Key(name)
10}
11
12// Bool creates a new key-value pair with a passed name and a bool
13// value.
14func Bool(k string, v bool) core.KeyValue {
15	return New(k).Bool(v)
16}
17
18// Int64 creates a new key-value pair with a passed name and an int64
19// value.
20func Int64(k string, v int64) core.KeyValue {
21	return New(k).Int64(v)
22}
23
24// Uint64 creates a new key-value pair with a passed name and a uint64
25// value.
26func Uint64(k string, v uint64) core.KeyValue {
27	return New(k).Uint64(v)
28}
29
30// Float64 creates a new key-value pair with a passed name and a float64
31// value.
32func Float64(k string, v float64) core.KeyValue {
33	return New(k).Float64(v)
34}
35
36// Int32 creates a new key-value pair with a passed name and an int32
37// value.
38func Int32(k string, v int32) core.KeyValue {
39	return New(k).Int32(v)
40}
41
42// Uint32 creates a new key-value pair with a passed name and a uint32
43// value.
44func Uint32(k string, v uint32) core.KeyValue {
45	return New(k).Uint32(v)
46}
47
48// Float32 creates a new key-value pair with a passed name and a float32
49// value.
50func Float32(k string, v float32) core.KeyValue {
51	return New(k).Float32(v)
52}
53
54// String creates a new key-value pair with a passed name and a string
55// value.
56func String(k, v string) core.KeyValue {
57	return New(k).String(v)
58}
59
60// Int creates a new key-value pair instance with a passed name and
61// either an int32 or an int64 value, depending on whether the int
62// type is 32 or 64 bits wide.
63func Int(k string, v int) core.KeyValue {
64	return New(k).Int(v)
65}
66
67// Uint creates a new key-value pair instance with a passed name and
68// either an uint32 or an uint64 value, depending on whether the uint
69// type is 32 or 64 bits wide.
70func Uint(k string, v uint) core.KeyValue {
71	return New(k).Uint(v)
72}
73