File: conn_others.go

package info (click to toggle)
golang-github-mdlayher-netlink 1.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 420 kB
  • sloc: makefile: 5
file content (30 lines) | stat: -rw-r--r-- 970 bytes parent folder | download | duplicates (3)
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
//go:build !linux
// +build !linux

package netlink

import (
	"fmt"
	"runtime"
)

// errUnimplemented is returned by all functions on platforms that
// cannot make use of netlink sockets.
var errUnimplemented = fmt.Errorf("netlink: not implemented on %s/%s",
	runtime.GOOS, runtime.GOARCH)

var _ Socket = &conn{}

// A conn is the no-op implementation of a netlink sockets connection.
type conn struct{}

// All cross-platform functions and Socket methods are unimplemented outside
// of Linux.

func dial(_ int, _ *Config) (*conn, uint32, error) { return nil, 0, errUnimplemented }
func newError(_ int) error                         { return errUnimplemented }

func (c *conn) Send(_ Message) error           { return errUnimplemented }
func (c *conn) SendMessages(_ []Message) error { return errUnimplemented }
func (c *conn) Receive() ([]Message, error)    { return nil, errUnimplemented }
func (c *conn) Close() error                   { return errUnimplemented }