-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hook for instance startup #1888
Conversation
@@ -199,6 +199,9 @@ func (i *Instance) Restart(newCaddyfile Input) (*Instance, error) { | |||
} | |||
i.Stop() | |||
|
|||
// Execute instantiation events | |||
EmitEvent(InstanceStartupEvent, newInst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add this to my PR 😄
Hey Eldin, I think it would be fair to make sure that @tantalic gets the credit in the commit; it's OK if there are two separate PRs. Smaller PRs are better. 😉 |
I have no issues giving credit for the first part of this PR You can merge this PR. I'll update my PR.... |
@tantalic Can you please rebase with master? I'll begin review after the merge conflict is resolved. |
Provides a new hook for plugins as a means to provide the current caddy.Instance when starting or restarting.
@mholt - The changes are now rebased on master. It appears CI builds are failing for some reason outside the scope of this change now. Please advise if you need anything else on this PR. |
Thanks for contributing! Really appreciate it. This'll go out in the next release. |
1. What does this change do, exactly?
Provides a new hook that plugins can use to gain access to the
caddy.Instance
. This is particularly important to allow plugins the ability to dynamically generate a new Caddyfile and reload the server with the new configuration.With this change in place a plugin could access the instance as follows:
2. Please link to the relevant issues.
3. Which documentation changes (if any) need to be made because of this PR?
4. Checklist