load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "libvirt",
    srcs = [
        "callbacks.go",
        "callbacks_helper.go",
        "callbacks_helper.h",
        "connect.go",
        "connect_helper.go",
        "connect_helper.h",
        "doc.go",
        "domain.go",
        "domain_checkpoint.go",
        "domain_events.go",
        "domain_events_helper.go",
        "domain_events_helper.h",
        "domain_snapshot.go",
        "error.go",
        "error_helper.go",
        "error_helper.h",
        "events.go",
        "events_helper.go",
        "events_helper.h",
        "interface.go",
        "libvirt_generated.h",
        "libvirt_generated_callbacks.h",
        "libvirt_generated_dlopen.h",
        "libvirt_generated_enums.h",
        "libvirt_generated_functions.h",
        "libvirt_generated_functions_static_common.go",
        "libvirt_generated_functions_static_domain.go",
        "libvirt_generated_functions_static_domain_checkpoint.go",
        "libvirt_generated_functions_static_domain_snapshot.go",
        "libvirt_generated_functions_static_event.go",
        "libvirt_generated_functions_static_host.go",
        "libvirt_generated_functions_static_interface.go",
        "libvirt_generated_functions_static_network.go",
        "libvirt_generated_functions_static_nodedev.go",
        "libvirt_generated_functions_static_nwfilter.go",
        "libvirt_generated_functions_static_secret.go",
        "libvirt_generated_functions_static_storage.go",
        "libvirt_generated_functions_static_stream.go",
        "libvirt_generated_functions_static_virterror.go",
        "libvirt_generated_macros.h",
        "libvirt_generated_structs.h",
        "libvirt_generated_typedefs.h",
        "libvirt_generated_variables.h",
        "libvirt_lxc_generated.h",
        "libvirt_lxc_generated_callbacks.h",
        "libvirt_lxc_generated_dlopen.h",
        "libvirt_lxc_generated_enums.h",
        "libvirt_lxc_generated_functions.h",
        "libvirt_lxc_generated_functions_static.go",
        "libvirt_lxc_generated_macros.h",
        "libvirt_lxc_generated_structs.h",
        "libvirt_lxc_generated_typedefs.h",
        "libvirt_lxc_generated_variables.h",
        "libvirt_qemu_generated.h",
        "libvirt_qemu_generated_callbacks.h",
        "libvirt_qemu_generated_dlopen.h",
        "libvirt_qemu_generated_enums.h",
        "libvirt_qemu_generated_functions.h",
        "libvirt_qemu_generated_functions_static.go",
        "libvirt_qemu_generated_macros.h",
        "libvirt_qemu_generated_structs.h",
        "libvirt_qemu_generated_typedefs.h",
        "libvirt_qemu_generated_variables.h",
        "lxc.go",
        "network.go",
        "network_events.go",
        "network_events_helper.go",
        "network_events_helper.h",
        "network_port.go",
        "node_device.go",
        "node_device_events.go",
        "node_device_events_helper.go",
        "node_device_events_helper.h",
        "nwfilter.go",
        "nwfilter_binding.go",
        "qemu.go",
        "qemu_helper.go",
        "qemu_helper.h",
        "secret.go",
        "secret_events.go",
        "secret_events_helper.go",
        "secret_events_helper.h",
        "storage_pool.go",
        "storage_pool_events.go",
        "storage_pool_events_helper.go",
        "storage_pool_events_helper.h",
        "storage_volume.go",
        "stream.go",
        "stream_helper.go",
        "stream_helper.h",
        "typedparams.go",
    ],
    cdeps = [
        "@//nix/cc:libvirt",
    ],
    cgo = True,
    importpath = "libvirt.org/go/libvirt",
    visibility = ["//visibility:public"],
)

alias(
    name = "go_default_library",
    actual = ":libvirt",
    visibility = ["//visibility:public"],
)

go_test(
    name = "libvirt_test",
    srcs = [
        "common_test.go",
        "connect_test.go",
        "domain_events_test.go",
        "domain_test.go",
        "interface_test.go",
        "network_events_test.go",
        "network_test.go",
        "node_device_events_test.go",
        "storage_pool_events_test.go",
        "storage_pool_test.go",
        "storage_volume_test.go",
        "typedparams_test.go",
    ],
    embed = [":libvirt"],
)
