role

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package role provides roles, which are a way to share common attributes and run lists between different nodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetList

func GetList() []string

GetList gets a list of the roles on this server.

Types

type Role

type Role struct {
	Name        string                 `json:"name"`
	ChefType    string                 `json:"chef_type"`
	JSONClass   string                 `json:"json_class"`
	RunList     []string               `json:"run_list"`
	EnvRunLists map[string][]string    `json:"env_run_lists"`
	Description string                 `json:"description"`
	Default     map[string]interface{} `json:"default_attributes"`
	Override    map[string]interface{} `json:"override_attributes"`
}

Role is a way to specify shared run lists and attributes for nodes.

func AllRoles added in v0.5.2

func AllRoles() []*Role

AllRoles returns all the roles on the server

func Get

func Get(roleName string) (*Role, error)

Get a role.

func GetMulti added in v0.10.0

func GetMulti(roleNames []string) ([]*Role, util.Gerror)

GetMulti gets multiple roles from a slice of role names.

func New

func New(name string) (*Role, util.Gerror)

New creates a new role.

func NewFromJSON added in v0.6.0

func NewFromJSON(jsonRole map[string]interface{}) (*Role, util.Gerror)

NewFromJSON creates a new role from the uploaded JSON.

func (*Role) Delete

func (r *Role) Delete() error

Delete a role.

func (*Role) DocID added in v0.6.0

func (r *Role) DocID() string

DocID returns the role's name.

func (*Role) Flatten

func (r *Role) Flatten() map[string]interface{}

Flatten a role so it's suitable for indexing.

func (*Role) GetName

func (r *Role) GetName() string

GetName returns the role's name.

func (*Role) Index

func (r *Role) Index() string

Index tells the indexer where it should put the role when it's being indexed.

func (*Role) Save

func (r *Role) Save() error

Save the role.

func (*Role) URLType

func (r *Role) URLType() string

URLType returns the base element of a role's URL.

func (*Role) UpdateFromJSON added in v0.6.0

func (r *Role) UpdateFromJSON(jsonRole map[string]interface{}) util.Gerror

UpdateFromJSON updates an existing role with the uploaded JSON.

Jump to

Keyboard shortcuts

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