-
Notifications
You must be signed in to change notification settings - Fork 10
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
479b20f
commit cc011f6
Showing
6 changed files
with
187 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Package messages provides structures for handling communication messages between the client and the VaaS server. | ||
package messages | ||
|
||
import ( | ||
"github.com/GDATASoftwareAG/vaas/golang/vaas/pkg/options" | ||
"github.com/google/uuid" | ||
) | ||
|
||
// VerdictRequestForURL is a specific implementation of VerdictRequest used for URL analysis requests. | ||
type verdictRequestForStream struct { | ||
Kind Kind `json:"kind" default:"VerdictRequestForStream"` | ||
GUID string `json:"guid"` | ||
SessionID string `json:"session_id"` | ||
VerdictRequestAttributes VerdictRequestAttributes `json:"verdict_request_attributes"` | ||
UseCache bool `json:"use_cache"` | ||
UseHashLookup bool `json:"use_shed"` | ||
} | ||
|
||
// GetGUID returns the GUID of the verdictRequestForURL. | ||
func (r verdictRequestForStream) GetGUID() string { | ||
return r.GUID | ||
} | ||
|
||
// NewVerdictRequestForURL creates a new verdictRequestForURL instance. | ||
func NewVerdictRequestForStream(sessionID string, options options.VaasOptions) VerdictRequest { | ||
return verdictRequestForStream{ | ||
Kind: VerdictRequestForStreamKind, | ||
SessionID: sessionID, | ||
GUID: uuid.New().String(), | ||
UseCache: options.UseCache, | ||
UseHashLookup: options.UseHashLookup, | ||
} | ||
} | ||
|
||
// NewVerdictRequestForURLWithAttributes creates a new verdictRequestForURL instance with attributes. | ||
func NewVerdictRequestForStreamWithAttributes(sessionID string, options options.VaasOptions, attributes VerdictRequestAttributes) VerdictRequest { | ||
return verdictRequestForStream{ | ||
Kind: VerdictRequestForStreamKind, | ||
SessionID: sessionID, | ||
GUID: uuid.New().String(), | ||
UseCache: options.UseCache, | ||
UseHashLookup: options.UseHashLookup, | ||
VerdictRequestAttributes: attributes, | ||
} | ||
} |
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