1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
4 // VPP: 20.05.1-release
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
29 // LogLevel defines enum 'log_level'.
33 VPE_API_LOG_LEVEL_EMERG LogLevel = 0
34 VPE_API_LOG_LEVEL_ALERT LogLevel = 1
35 VPE_API_LOG_LEVEL_CRIT LogLevel = 2
36 VPE_API_LOG_LEVEL_ERR LogLevel = 3
37 VPE_API_LOG_LEVEL_WARNING LogLevel = 4
38 VPE_API_LOG_LEVEL_NOTICE LogLevel = 5
39 VPE_API_LOG_LEVEL_INFO LogLevel = 6
40 VPE_API_LOG_LEVEL_DEBUG LogLevel = 7
41 VPE_API_LOG_LEVEL_DISABLED LogLevel = 8
45 LogLevel_name = map[uint32]string{
46 0: "VPE_API_LOG_LEVEL_EMERG",
47 1: "VPE_API_LOG_LEVEL_ALERT",
48 2: "VPE_API_LOG_LEVEL_CRIT",
49 3: "VPE_API_LOG_LEVEL_ERR",
50 4: "VPE_API_LOG_LEVEL_WARNING",
51 5: "VPE_API_LOG_LEVEL_NOTICE",
52 6: "VPE_API_LOG_LEVEL_INFO",
53 7: "VPE_API_LOG_LEVEL_DEBUG",
54 8: "VPE_API_LOG_LEVEL_DISABLED",
56 LogLevel_value = map[string]uint32{
57 "VPE_API_LOG_LEVEL_EMERG": 0,
58 "VPE_API_LOG_LEVEL_ALERT": 1,
59 "VPE_API_LOG_LEVEL_CRIT": 2,
60 "VPE_API_LOG_LEVEL_ERR": 3,
61 "VPE_API_LOG_LEVEL_WARNING": 4,
62 "VPE_API_LOG_LEVEL_NOTICE": 5,
63 "VPE_API_LOG_LEVEL_INFO": 6,
64 "VPE_API_LOG_LEVEL_DEBUG": 7,
65 "VPE_API_LOG_LEVEL_DISABLED": 8,
69 func (x LogLevel) String() string {
70 s, ok := LogLevel_name[uint32(x)]
74 return "LogLevel(" + strconv.Itoa(int(x)) + ")"
77 // Timedelta defines alias 'timedelta'.
78 type Timedelta float64
80 // Timestamp defines alias 'timestamp'.
81 type Timestamp float64
83 func NewTimestamp(t time.Time) Timestamp {
84 sec := int64(t.Unix())
85 nsec := int32(t.Nanosecond())
86 ns := float64(sec) + float64(nsec/1e9)
89 func (x Timestamp) ToTime() time.Time {
93 return time.Unix(sec, nsec)
95 func (x Timestamp) String() string {
96 return x.ToTime().String()
98 func (x *Timestamp) MarshalText() ([]byte, error) {
99 return []byte(x.ToTime().Format(time.RFC3339Nano)), nil
101 func (x *Timestamp) UnmarshalText(text []byte) error {
102 t, err := time.Parse(time.RFC3339Nano, string(text))
110 // Version defines type 'version'.
111 type Version struct {
112 Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
113 Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
114 Patch uint32 `binapi:"u32,name=patch" json:"patch,omitempty"`
115 PreRelease []byte `binapi:"u8[17],name=pre_release" json:"pre_release,omitempty"`
116 BuildMetadata []byte `binapi:"u8[17],name=build_metadata" json:"build_metadata,omitempty"`