forked from raystack/frontier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da5b1fa
commit 05d7fec
Showing
15 changed files
with
928 additions
and
31 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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package ads | ||
|
||
import ( | ||
"context" | ||
"time" | ||
|
||
"github.com/goto/shield/core/rule" | ||
) | ||
|
||
const ( | ||
CLUSTER_TYPE_URL = "type.googleapis.com/envoy.config.cluster.v3.Cluster" | ||
LISTENER_TYPE_URL = "type.googleapis.com/envoy.config.listener.v3.Listener" | ||
ROUTE_CONFIGURATION_TYPE_URL = "type.googleapis.com/envoy.config.route.v3.RouteConfiguration" | ||
|
||
HTTP_CONNECTION_MANAGER_TYPE_URL = "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager" | ||
ROUTER_TYPE_URL = "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router" | ||
URI_TEMPLATE_TYPE_URL = "type.googleapis.com/envoy.extensions.path.match.uri_template.v3.UriTemplateMatchConfig" | ||
STDOUT_LOGGER_TYPE_URL = "type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog" | ||
) | ||
|
||
type Repository interface { | ||
GetAll(ctx context.Context) ([]rule.Ruleset, error) | ||
IsUpdated(ctx context.Context, since time.Time) bool | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package ads | ||
|
||
import "errors" | ||
|
||
type Message struct { | ||
NodeID string | ||
VersionInfo string | ||
Nonce string | ||
} | ||
|
||
type MessageChan chan Message | ||
|
||
var ( | ||
ErrChannelClosed = errors.New("can't send message on closed channel") | ||
) | ||
|
||
func (m MessageChan) Push(message Message) (err error) { | ||
defer func() { | ||
if recover() != nil { | ||
err = ErrChannelClosed | ||
} | ||
}() | ||
|
||
m <- message | ||
return nil | ||
} |
Oops, something went wrong.