datlabel

package module
v0.0.0-...-4c847b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2020 License: MIT Imports: 7 Imported by: 0

README

Datlabel

Build Status

Datlabel is a micro Go library that aims to make the searching, listing and filtering of labels in Docker containers and services as easy as possible. On top of that, it offers the possibility to search on Stacks too.

Build

The library is a standard Go project that uses modules. In order to build it, open a shell and type:

go build github.com/Polpetta/datlabel

Testing

The project has tests too. In order to run them, you need a local and working Docker installation. On top of that, your Docker installation needs to be set up in Swarm mode. To wrap up, you need to follow this procedure:

docker swarm init # This initialize Docker into Swarm configuration
go test -tags=unit -count=1 ./... # Launch unit tests
go test -tags=intergation -count=1 ./... # Launch integration tests
docker swarm leave -f # Set it back Docker to classic mode

Alternatively, you can execute all the tests in one shot with:

go test -tags="unit integration" -count=1 ./...

License

This software is licensed under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainersFromLabel

func ContainersFromLabel(label *result.Label) (result.ContainerResult, error)

func GetLabelsFromContainer

func GetLabelsFromContainer(containerId string) (result.LabelResult, error)

Given a container id, the function returns the current labels only, without any field description.

func GetLabelsFromService

func GetLabelsFromService(serviceId string) (result.LabelResult, error)

Given a service id, the function returns the service labels without any filed description

func GetLabelsFromStack

func GetLabelsFromStack(stackName string) (result.LabelResult, error)

The idea here is to return all the labels a stack has, in order to collect them in a list

func Services

func Services() (result.ServiceResult, error)

func ServicesFromLabel

func ServicesFromLabel(label *result.Label) (result.ServiceResult, error)

Types

This section is empty.

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL