Crate cni_plugin[][src]

Library to write CNI plugins.

Quick start

use cni_plugin::{Cni, install_logger};
install_logger("hello-world.log");
match Cni::load() {
    Cni::Add { container_id, ifname, netns, path, config } => {}
    Cni::Del { container_id, ifname, netns, path, config } => {}
    Cni::Check { container_id, ifname, netns, path, config } => {}
    Cni::Version(_) => unreachable!()
}

Modules

config

Configuration structures.

delegation

Plugin delegation.

error

When CNI goes bad.

ip_range

The IpRange type and helpers for IP pools.

reply

Reply types and helpers.

Structs

Inputs

An alternate representation of plugin inputs.

Enums

Cni

The main entrypoint to this plugin and the enum which contains plugin input.

Command

Identifies the command given to a plugin.

Functions

install_logger

Install the standard logger for plugins.