Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
guidon-client
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PublicSource
guidon-client
Commits
3a81ddff
Commit
3a81ddff
authored
Oct 09, 2025
by
张醒狮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add gitignore file
parent
663098df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
.gitignore
.gitignore
+1
-0
resource_center.go
client/resource_center.go
+35
-0
No files found.
.gitignore
0 → 100644
View file @
3a81ddff
.idea
\ No newline at end of file
client/resource_center.go
0 → 100644
View file @
3a81ddff
package
client
import
(
"context"
"git.zmcms.cn/publicsource/guidon-client/pb"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"time"
)
type
ResourceCenterClient
struct
{
conn
*
grpc
.
ClientConn
client
pb
.
ResourceCenterClient
}
func
NewResourceCenterClient
(
addr
string
)
(
*
ResourceCenterClient
,
error
)
{
conn
,
err
:=
grpc
.
NewClient
(
addr
,
grpc
.
WithTransportCredentials
(
insecure
.
NewCredentials
()))
if
err
!=
nil
{
return
nil
,
err
}
return
&
ResourceCenterClient
{
conn
:
conn
,
client
:
pb
.
NewResourceCenterClient
(
conn
)},
nil
}
func
(
rc
*
ResourceCenterClient
)
Close
()
error
{
return
rc
.
conn
.
Close
()
}
func
(
rc
*
ResourceCenterClient
)
GetOwnership
(
ctx
context
.
Context
,
resourceId
string
)
(
*
pb
.
OwnershipResponse
,
error
)
{
req
:=
&
pb
.
OwnershipRequest
{
InstanceId
:
resourceId
}
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
3
*
time
.
Second
)
defer
cancel
()
return
rc
.
client
.
GetOwnership
(
ctx
,
req
)
}
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