1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0
5 // source: /usr/share/vpp/api/core/vpe_types.api.json
7 // Package vpe_types contains generated bindings for API file vpe_types.api.
20 api "git.fd.io/govpp.git/api"
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
32 VersionCrc = 0x5f754a1c
35 // LogLevel defines enum 'log_level'.
39 VPE_API_LOG_LEVEL_EMERG LogLevel = 0
40 VPE_API_LOG_LEVEL_ALERT LogLevel = 1
41 VPE_API_LOG_LEVEL_CRIT LogLevel = 2
42 VPE_API_LOG_LEVEL_ERR LogLevel = 3
43 VPE_API_LOG_LEVEL_WARNING LogLevel = 4
44 VPE_API_LOG_LEVEL_NOTICE LogLevel = 5
45 VPE_API_LOG_LEVEL_INFO LogLevel = 6
46 VPE_API_LOG_LEVEL_DEBUG LogLevel = 7
47 VPE_API_LOG_LEVEL_DISABLED LogLevel = 8
51 LogLevel_name = map[uint32]string{
52 0: "VPE_API_LOG_LEVEL_EMERG",
53 1: "VPE_API_LOG_LEVEL_ALERT",
54 2: "VPE_API_LOG_LEVEL_CRIT",
55 3: "VPE_API_LOG_LEVEL_ERR",
56 4: "VPE_API_LOG_LEVEL_WARNING",
57 5: "VPE_API_LOG_LEVEL_NOTICE",
58 6: "VPE_API_LOG_LEVEL_INFO",
59 7: "VPE_API_LOG_LEVEL_DEBUG",
60 8: "VPE_API_LOG_LEVEL_DISABLED",
62 LogLevel_value = map[string]uint32{
63 "VPE_API_LOG_LEVEL_EMERG": 0,
64 "VPE_API_LOG_LEVEL_ALERT": 1,
65 "VPE_API_LOG_LEVEL_CRIT": 2,
66 "VPE_API_LOG_LEVEL_ERR": 3,
67 "VPE_API_LOG_LEVEL_WARNING": 4,
68 "VPE_API_LOG_LEVEL_NOTICE": 5,
69 "VPE_API_LOG_LEVEL_INFO": 6,
70 "VPE_API_LOG_LEVEL_DEBUG": 7,
71 "VPE_API_LOG_LEVEL_DISABLED": 8,
75 func (x LogLevel) String() string {
76 s, ok := LogLevel_name[uint32(x)]
80 return "LogLevel(" + strconv.Itoa(int(x)) + ")"
83 // Timedelta defines alias 'timedelta'.
84 type Timedelta float64
86 // Timestamp defines alias 'timestamp'.
87 type Timestamp float64
89 func NewTimestamp(t time.Time) Timestamp {
90 sec := int64(t.Unix())
91 nsec := int32(t.Nanosecond())
92 ns := float64(sec) + float64(nsec/1e9)
96 func (x Timestamp) ToTime() time.Time {
100 return time.Unix(sec, nsec)
103 func (x Timestamp) String() string {
104 return x.ToTime().String()
107 func (x *Timestamp) MarshalText() ([]byte, error) {
108 return []byte(x.ToTime().Format(time.RFC3339Nano)), nil
111 func (x *Timestamp) UnmarshalText(text []byte) error {
112 t, err := time.Parse(time.RFC3339Nano, string(text))
120 // Version defines type 'version'.
121 type Version struct {
122 Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
123 Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
124 Patch uint32 `binapi:"u32,name=patch" json:"patch,omitempty"`
125 PreRelease []byte `binapi:"u8[17],name=pre_release" json:"pre_release,omitempty"`
126 BuildMetadata []byte `binapi:"u8[17],name=build_metadata" json:"build_metadata,omitempty"`