This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from rogpeppe/033-better-docs
all: add some doc comments
- Loading branch information
Showing
10 changed files
with
159 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,10 @@ | ||
// Package mycharm implements the simplest possible Go charm. | ||
// Package do-nothing implements the simplest possible Go charm. | ||
// It does nothing at all when deployed. | ||
package mycharm | ||
package runhook | ||
|
||
import ( | ||
"github.com/juju/gocharm/hook" | ||
) | ||
|
||
type nothing struct { | ||
ctxt *hook.Context | ||
} | ||
|
||
func RegisterHooks(r *hook.Registry) { | ||
var n nothing | ||
r.RegisterContext(n.setContext, nil) | ||
r.RegisterHook("install", n.hook) | ||
r.RegisterHook("start", n.hook) | ||
r.RegisterHook("config-changed", n.hook) | ||
} | ||
|
||
func (n *nothing) setContext(ctxt *hook.Context) error { | ||
n.ctxt = ctxt | ||
return nil | ||
} | ||
|
||
func (n *nothing) hook() error { | ||
n.ctxt.Logf("hook %s is doing nothing at all", n.ctxt.HookName) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Package hooktest contains utilities for testing gocharm hooks. | ||
package hooktest | ||
|
||
import ( | ||
|