File: types.go

package info (click to toggle)
golang-github-appc-cni 1.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,132 kB
  • sloc: sh: 154; makefile: 7
file content (31 lines) | stat: -rw-r--r-- 693 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package current

import (
	"github.com/containernetworking/cni/pkg/types"
	types020 "github.com/containernetworking/cni/pkg/types/020"
	types040 "github.com/containernetworking/cni/pkg/types/040"
)

const ImplementedSpecVersion = types040.ImplementedSpecVersion

var (
	NewResult = types040.NewResult
	GetResult = types040.GetResult
	Int       = types040.Int
)

type (
	Result    = types040.Result
	Interface = types040.Interface
	IPConfig  = types040.IPConfig
)

func NewResultFromResult(result types.Result) (*Result, error) {
	if result.Version() == "" {
		switch r := result.(type) {
		case *types020.Result:
			r.CNIVersion = "0.1.0"
		}
	}
	return types040.NewResultFromResult(result)
}