concat

package
v0.0.0-...-c60bc85 Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: LGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

The concat package implements a charm that takes all the string values from units on upstream relations, concatenates them and makes them available to downstream relations.

This provides a silly but simple example that allows the exploration of relation behaviour in Juju.

For example, here's an example of this being used from the juju-utils repository:

JUJU_REPOSITORY=$GOPATH/src/launchpad.net/juju-utils/cmd/gocharm/example-charms
export JUJU_REPOSITORY
gocharm
juju deploy local:concat concattop
juju deploy local:concat concat1
juju deploy local:concat concat2
juju deploy local:concat concatjoin
juju add-relation concattop:downstream concat1:upstream
juju add-relation concattop:downstream concat2:upstream
juju add-relation concat1:downstream concatjoin:upstream
juju add-relation concat2:downstream concatjoin:upstream
juju set concattop 'val=top'
juju set concat1 'val=concat1'
juju set concat2 'val=concat2'
juju set concatjoin 'val=concatjoin'

The final value of the downstream relation provided by by the concatjoin service in this case will be:

{concatjoin {concat2 {top}} {concat1 {top}}}

Feedback loops can be arranged for further amusement.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHooks

func RegisterHooks(r *hook.Registry)

Types

type ConcatServer

type ConcatServer struct {
	// contains filtered or unexported fields
}

ConcatServer defines the operations on the service's local RPC server that is used for communication between the charm and the running service.

Note that this type must be exported because of the rules about net/rpc types.

func (*ConcatServer) Set

func (svc *ConcatServer) Set(p *ServerState, _ *struct{}) error

SetVal sets the current value served by the HTTP server and starts the server running if it is not already started.

type ServerState

type ServerState struct {
	Val  string
	Port int
}

ServerState holds the state of a server.

Jump to

Keyboard shortcuts

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