ansible

package
v0.0.0-...-dc5648e Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package ansible is providing data structures and functions for responses when rocker-compose is running in ansible mode (rocker-compose run --ansible)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Changed bool                `json:"changed"`
	Failed  bool                `json:"failed"`
	Message string              `json:"msg"`
	Removed []ResponseContainer `json:"removed"`
	Created []ResponseContainer `json:"created"`
	Pulled  []string            `json:"pulled"`
	Cleaned []string            `json:"cleaned"`
}

Response is data structure that providing json response to ansible

func (*Response) Encode

func (r *Response) Encode() ([]byte, error)

Encode marshals response to JSON

func (*Response) Error

func (r *Response) Error(msg error) *Response

Error marks response as failed and store error message

func (*Response) Success

func (r *Response) Success(msg string) *Response

Success marks response as successful and store message

func (*Response) WriteTo

func (r *Response) WriteTo(w io.Writer) (int64, error)

WriteTo writes json encoded response to a given io.Writer NOTE: `go vet` wants the return value to be int64 for some reason

however, io.Writer returns int. So we have to cast it manually

type ResponseContainer

type ResponseContainer struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

ResponseContainer describes added or removed container

Jump to

Keyboard shortcuts

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