-
Notifications
You must be signed in to change notification settings - Fork 41
/
wssd.go
36 lines (29 loc) · 914 Bytes
/
wssd.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache v2.0 License.
package internal
import (
"context"
mocclient "github.com/microsoft/moc-sdk-for-go/pkg/client"
"github.com/microsoft/moc/pkg/auth"
mocadmin "github.com/microsoft/moc/rpc/common/admin"
)
type client struct {
mocadmin.ValidationAgentClient
}
// NewValidationgingClient - creates a client session with the backend wssd agent
func NewValidationClient(subID string, authorizer auth.Authorizer) (*client, error) {
c, err := mocclient.GetValidationClient(&subID, authorizer)
if err != nil {
return nil, err
}
return &client{c}, nil
}
// Get
func (c *client) Validate(ctx context.Context) error {
request := getValidationRequest()
_, err := c.ValidationAgentClient.Invoke(ctx, request)
return err
}
func getValidationRequest() *mocadmin.ValidationRequest {
return &mocadmin.ValidationRequest{}
}