Skip to content

Commit 3a07603

Browse files
authored
Merge pull request #3 from trendmicro/update_to_latest_version
updated to latest version
2 parents b138fd6 + c87a1ae commit 3a07603

File tree

13 files changed

+525
-277
lines changed

13 files changed

+525
-277
lines changed

README.md

Lines changed: 31 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To integrate with our service using the Golang SDK, you need to import the SDK p
3333

3434
## Obtain an API Key
3535

36-
The File Security SDK requires a valid API Key provided as parameter to the SDK client object. It can accept Trend Vision One API keys.
36+
The File Security SDK requires a valid API Key provided as parameter to the SDK client object. It can accept Trend Vision One API keys.
3737

3838
When obtaining the API Key, ensure that the API Key is associated with the region that you plan to use. It is important to note that Trend Vision One API Keys are associated with different regions, please refer to the region flag below to obtain a better understanding of the valid regions associated with the respective API Key.
3939

@@ -77,8 +77,9 @@ Once you have initialized the SDK, you can start using it to interact with our s
7777
7878
```go
7979
filePath := "path/to/your/file.txt"
80+
tags := []string{"tag1", "tag2"}
8081
81-
response, err := client.ScanFile(filePath)
82+
response, err := client.ScanFile(filePath, tags)
8283
if err != nil {
8384
// Handle scanning error
8485
panic(err)
@@ -92,8 +93,9 @@ if err != nil {
9293
```go
9394
data := []byte("Your data to be scanned")
9495
identifier := "UniqueIdentifier"
96+
tags := []string{"tag1", "tag2"}
9597
96-
response, err := client.ScanBuffer(data, identifier)
98+
response, err := client.ScanBuffer(data, identifier, tags)
9799
if err != nil {
98100
// Handle scanning error
99101
panic(err)
@@ -102,27 +104,9 @@ if err != nil {
102104
// Use the 'response' as needed
103105
```
104106
105-
## Advanced Configuration
107+
**_Note_**
108+
- Max number of tags is 8. And the length of each tag can't exceed 63.
106109

107-
The SDK provides additional configuration options and functions that you can use to customize its behavior. Here are some advanced configuration options:
108-
109-
### Getting Timeout Setting
110-
111-
You can retrieve the current timeout setting:
112-
113-
```go
114-
timeout := client.GetTimeoutSetting()
115-
fmt.Printf("Current Timeout Setting: %d seconds\n", timeout)
116-
```
117-
118-
### Getting Connection and Authentication Context
119-
120-
You can access the underlying gRPC connection and authentication context:
121-
122-
```go
123-
conn := client.GetConnection() // Get the gRPC connection
124-
ctx := client.ConfigAuth(context.Background()) // Get the authentication context
125-
```
126110
## Additional Functions
127111

128112
The SDK provides additional functions for advanced usage, such as dumping the configuration and cleaning up resources:
@@ -172,20 +156,20 @@ This program is located in the `tools/` folder. It supports the gRPC-based serve
172156

173157
The following flags are supported:
174158

175-
`-tls`
176-
Specify to enable server authentication by client for gRPC
159+
`-tls`
160+
Specify to enable server authentication by client for gRPC
177161

178-
`-region <string>`
179-
Specify the region to connect to for gRPC
162+
`-region <string>`
163+
Specify the region to connect to for gRPC
180164

181-
`-addr <string>`
182-
the address to connect to for gRPC (default "localhost:50051")
165+
`-addr <string>`
166+
the address to connect to for gRPC (default "localhost:50051")
183167

184-
`-filename <string>`
185-
Path of file to scan
168+
`-filename <string>`
169+
Path of file to scan
186170

187-
`-apikey <string>`
188-
API key for service authentication if authentication is enabled
171+
`-apikey <string>`
172+
API key for service authentication if authentication is enabled
189173

190174
### scanfiles
191175

@@ -195,23 +179,23 @@ If `-good` flag is specified, it indicates the files to be scanned are non-malic
195179

196180
The following flags are supported by the program:
197181

198-
`-path <string>`
199-
Directory or file to scan. This flag must be specified in all scenarios.
182+
`-path <string>`
183+
Directory or file to scan. This flag must be specified in all scenarios.
200184

201-
`-good`
202-
Specify if scanning good/non-malicious files.
185+
`-good`
186+
Specify if scanning good/non-malicious files.
203187

204-
`-parallel`
205-
Specify if scanning of multiple files should be carried out simultaneously instead of sequentially.
188+
`-parallel`
189+
Specify if scanning of multiple files should be carried out simultaneously instead of sequentially.
206190

207-
`-tls`
208-
Specify to enable server authentication by client for gRPC
191+
`-tls`
192+
Specify to enable server authentication by client for gRPC
209193

210-
`-region <string>`
211-
Specify the region to connect to for gRPC
194+
`-region <string>`
195+
Specify the region to connect to for gRPC
212196

213-
`-addr <string>`
214-
The address to connect to for gRPC (default "localhost:50051")
197+
`-addr <string>`
198+
The address to connect to for gRPC (default "localhost:50051")
215199

216-
`-apikey <string>`
217-
API key for service authentication if authentication is enabled
200+
`-apikey <string>`
201+
API key for service authentication if authentication is enabled

client/base/scan.pb.go

Lines changed: 45 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/base/scan_grpc.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)