utils

package
v2.1.0-rc3+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 5 Imported by: 74

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(collection []string, key string) bool

func Convert

func Convert(src, target interface{}) error

Convert converts a struct (src) to another one (target) using yaml marshalling/unmarshalling. If the structure are not compatible, this will throw an error as the unmarshalling will fail.

func VersionBetween

func VersionBetween(a, b, c string) bool

func VersionGreaterThan

func VersionGreaterThan(a, b string) bool

func VersionSatisfiesRange

func VersionSatisfiesRange(v, rng string) (bool, error)

Types

type Config

type Config struct {
	Version  string                 `yaml:"version,omitempty"`
	Services RawServiceMap          `yaml:"services,omitempty"`
	Volumes  map[string]interface{} `yaml:"volumes,omitempty"`
	Networks map[string]interface{} `yaml:"networks,omitempty"`
}

Config holds libcompose top level configuration

func CreateConfig

func CreateConfig(bytes []byte) (*Config, error)

CreateConfig unmarshals bytes to config and creates config based on version

type RawService

type RawService map[string]interface{}

RawService is represent a Service in map form unparsed

type RawServiceMap

type RawServiceMap map[string]RawService

RawServiceMap is a collection of RawServices

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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