-
Notifications
You must be signed in to change notification settings - Fork 17
/
service.go
38 lines (29 loc) · 900 Bytes
/
service.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
37
38
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package document
// ServiceEndpointProperty describes external service endpoint property.
const ServiceEndpointProperty = "serviceEndpoint"
// Service represents any type of service the entity wishes to advertise.
type Service map[string]interface{}
// NewService creates new service.
func NewService(m map[string]interface{}) Service {
return m
}
// ID is service ID.
func (s Service) ID() string {
return stringEntry(s[IDProperty])
}
// Type is service type.
func (s Service) Type() string {
return stringEntry(s[TypeProperty])
}
// ServiceEndpoint is service endpoint.
func (s Service) ServiceEndpoint() interface{} {
return s[ServiceEndpointProperty]
}
// JSONLdObject returns map that represents JSON LD Object.
func (s Service) JSONLdObject() map[string]interface{} {
return s
}