Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
44fc9b18
Commit
44fc9b18
authored
8 years ago
by
Abiola Ibrahim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print the directives in order of priority.
parent
3b6c387b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
caddy/directives.go
caddy/directives.go
+9
-0
main.go
main.go
+1
-2
No files found.
caddy/directives.go
View file @
44fc9b18
...
...
@@ -69,6 +69,15 @@ var directiveOrder = []directive{
{
"browse"
,
setup
.
Browse
},
}
// Directives returns the list of directives in order of priority.
func
Directives
()
[]
string
{
directives
:=
make
([]
string
,
len
(
directiveOrder
))
for
i
,
d
:=
range
directiveOrder
{
directives
[
i
]
=
d
.
name
}
return
directives
}
// RegisterDirective adds the given directive to caddy's list of directives.
// Pass the name of a directive you want it to be placed after,
// otherwise it will be placed at the bottom of the stack.
...
...
This diff is collapsed.
Click to expand it.
main.go
View file @
44fc9b18
...
...
@@ -14,7 +14,6 @@ import (
"github.com/mholt/caddy/caddy"
"github.com/mholt/caddy/caddy/https"
"github.com/mholt/caddy/caddy/parse"
"github.com/xenolf/lego/acme"
"gopkg.in/natefinch/lumberjack.v2"
)
...
...
@@ -80,7 +79,7 @@ func main() {
os
.
Exit
(
0
)
}
if
directives
{
for
d
:=
range
parse
.
ValidDirectives
{
for
_
,
d
:=
range
caddy
.
Directives
()
{
fmt
.
Println
(
d
)
}
os
.
Exit
(
0
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment