doittypes

package module
v0.0.0-...-2203db9 Latest Latest
Warning

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

Go to latest
Published: May 25, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

README

doittypes

Shared data types for various doit apps

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ansible

type Ansible interface {
	//MarshalAnsilbe
	MarshalAnsible() map[string]interface{}
}

Ansile interface to marshal a struct into an ansible consumable JSON structure

type Domain

type Domain struct {
	ID        int       `sql:"not null;unique;AUTO_INCREMENT" json:"id"`
	Name      string    `sql:"unique" json:"name"`
	Hosts     []*Host   `json:"hosts,omitempty"`
	Vars      []*Var    `json:"vars,omitempty"`
	Groups    []*Group  `json:"groups,omitempty"`
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`
}

Domain a container for all related objects under the same namespace

func (*Domain) MarshalAnsible

func (d *Domain) MarshalAnsible() map[string]interface{}

MarshalAnsilbe mashals the struct into an Ansible supported JSON

type Group

type Group struct {
	ID        int           `sql:"not null;unique;AUTO_INCREMENT" json:"id"`
	Name      string        `json:"name"`
	Domain    *Domain       `json:"-"`
	DomainID  sql.NullInt64 `json:"-"`
	Hosts     []*Host       `gorm:"many2many:group_hosts;" json:"hosts,omitempty"`
	Vars      []*Var        `gorm:"many2many:group_vars;" json:"vars,omitempty"`
	CreatedAt time.Time     `json:"-"`
	UpdatedAt time.Time     `json:"-"`
}

Group a container for host and var entities

func (*Group) MarshalAnsible

func (g *Group) MarshalAnsible() map[string]interface{}

MarshalAnsilbe mashals the struct into an Ansible supported JSON

type GroupMatrix

type GroupMatrix struct {
	ID      int `sql:"not null;unique;AUTO_INCREMENT" json:"id"`
	GroupID int
	Groups  []Group `gorm:"many2many:group_groupmatrixes;"`
}

type Host

type Host struct {
	ID        int           `sql:"not null;unique;AUTO_INCREMENT" json:"id"`
	Name      string        `json:"name"`
	Vars      []*Var        `gorm:"many2many:hostvars_vars;" json:"vars,omitempty"`
	Domain    *Domain       `json:"-"`
	DomainID  sql.NullInt64 `json:"-"`
	Group     *Group        `json:"-"`
	GroupID   sql.NullInt64 `json:"-"`
	CreatedAt time.Time     `json:"-"`
	UpdatedAt time.Time     `json:"-"`
}

Host a representation of a host entity

func (*Host) MarshalAnsible

func (h *Host) MarshalAnsible() map[string]interface{}

MarshalAnsilbe mashals the struct into an Ansible supported JSON

type Var

type Var struct {
	ID        int           `sql:"not null;unique;AUTO_INCREMENT" json:"id"`
	Domain    *Domain       `json:"-" `
	DomainID  sql.NullInt64 `json:"-"`
	Host      *Host         `json:"-"`
	HostID    sql.NullInt64 `json:"-"`
	Group     *Group        `json:"-"`
	GroupID   sql.NullInt64 `json:"-"`
	Name      string        `json:"name"`
	Value     string        `json:"value"`
	CreatedAt time.Time     `json:"-"`
	UpdatedAt time.Time     `json:"-"`
}

Var Variable to add

func (*Var) MarshalAnsible

func (v *Var) MarshalAnsible() map[string]interface{}

MarshalAnsilbe mashals the struct into an Ansible supported JSON

Directories

Path Synopsis
Godeps
_workspace/src/github.com/mattn/go-sqlite3
Package sqlite3 provides interface to SQLite3 databases.
Package sqlite3 provides interface to SQLite3 databases.

Jump to

Keyboard shortcuts

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