actor

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package actor in goiardi encompasses both Chef clients and users. They're basically the same thing. Clients are the more usual case - users are mainly used for the web interface (which goiardi doesn't have yet).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetList

func GetList() []string

Returns a list of actors. Clients and users are stored together, so no user can have the same name as an existing client (and vice versa).

Types

type Actor

type Actor struct {
	Name        string `json:"name"`
	NodeName    string `json:"node_name"`
	JsonClass   string `json:"json_class"`
	ChefType    string `json:"chef_type"`
	Validator   bool   `json:"validator"`
	Orgname     string `json:"orgname"`
	PublicKey   string `json:"public_key"`
	Admin       bool   `json:"admin"`
	Certificate string `json:"certificate"`
}

func Get

func Get(clientname string) (*Actor, error)

func New

func New(clientname string, cheftype string) (*Actor, util.Gerror)

func NewFromJson

func NewFromJson(json_actor map[string]interface{}, cheftype string) (*Actor, util.Gerror)

Build a new client/user from a json object

func (*Actor) Delete

func (c *Actor) Delete() error

func (*Actor) DocId

func (c *Actor) DocId() string

Search indexing functions

func (*Actor) Flatten

func (c *Actor) Flatten() []string

func (*Actor) GenerateKeys

func (c *Actor) GenerateKeys() (string, error)

Generate a new set of RSA keys for the client. The new private key is saved with the client, the public key is given to the client and not saved on the server at all. */

func (*Actor) GetName

func (a *Actor) GetName() string

func (*Actor) Index

func (c *Actor) Index() string

func (*Actor) Rename

func (c *Actor) Rename(new_name string) util.Gerror

Renames the client or user. Save() must be called after this method is used.

func (*Actor) Save

func (c *Actor) Save() error

func (*Actor) URLType

func (a *Actor) URLType() string

func (*Actor) UpdateFromJson

func (c *Actor) UpdateFromJson(json_actor map[string]interface{}, cheftype string) util.Gerror

Update a client/user from a json object. Does a bunch of validations inside rather than in the handler.

Jump to

Keyboard shortcuts

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