-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathtypes.go
36 lines (29 loc) · 1.09 KB
/
types.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
package kmip
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import (
"reflect"
"time"
)
// Tag is a number that designates the specific Protocol Field or Object that the TTLV object represents
type Tag uint32
// Type is a byte containing a coded value that indicates the data type of the data object
type Type uint8
// Enum is KMIP Enumeration type
type Enum uint32
// DynamicDispatch is an interface for structure go set field value based on other field values
type DynamicDispatch interface {
BuildFieldValue(name string) (interface{}, error)
}
var (
typeOfTag = reflect.TypeOf(Tag(0))
typeOfEnum = reflect.TypeOf(Enum(0))
typeOfInt32 = reflect.TypeOf(int32(0))
typeOfInt64 = reflect.TypeOf(int64(0))
typeOfBool = reflect.TypeOf(false)
typeOfBytes = reflect.TypeOf([]byte(nil))
typeOfString = reflect.TypeOf("")
typeOfTime = reflect.TypeOf(time.Time{})
typeOfDuration = reflect.TypeOf(time.Duration(0))
)