mirror of
https://github.com/kataras/iris.git
synced 2026-01-27 13:55:56 +00:00
Modification
- Add configurator for Party - Modification for CORS middleware example Former-commit-id: f01c01d4eac41666a92890461851909a6ade018b
This commit is contained in:
@@ -9,11 +9,18 @@ import (
|
||||
// Party is here to separate the concept of
|
||||
// api builder and the sub api builder.
|
||||
|
||||
// PartyConfigurator is handler for configuring a party (it works with iris.Application)
|
||||
type PartyConfigurator func(party Party)
|
||||
|
||||
// Party is just a group joiner of routes which have the same prefix and share same middleware(s) also.
|
||||
// Party could also be named as 'Join' or 'Node' or 'Group' , Party chosen because it is fun.
|
||||
//
|
||||
// Look the "APIBuilder" for its implementation.
|
||||
type Party interface {
|
||||
// ConfigureParty configures this party like `iris.Application#Configure`
|
||||
// That allows middlewares focused on the Party like CORS middleware
|
||||
ConfigureParty(...PartyConfigurator)
|
||||
|
||||
// GetRelPath returns the current party's relative path.
|
||||
// i.e:
|
||||
// if r := app.Party("/users"), then the `r.GetRelPath()` is the "/users".
|
||||
|
||||
Reference in New Issue
Block a user