File: requestStruct.go

package info (click to toggle)
golang-github-docker-goamz 0.0~git20160206.0.f0a21f5-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,580 kB
  • sloc: makefile: 66
file content (81 lines) | stat: -rw-r--r-- 1,862 bytes parent folder | download | duplicates (3)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package kms

type KMSAction interface {
	ActionName() string
}

type ProduceKeyOpt struct {
	EncryptionContext map[string]string `json:",omitempty"`
	GrantTokens       []string          `json:",omitempty"`
}

//The following structs are the parameters when requesting to AWS KMS
//http://docs.aws.amazon.com/kms/latest/APIReference/API_Operations.html
type DescribeKeyInfo struct {
	//4 forms for KeyId - http://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html
	//1. Key ARN
	//2. Alias ARN
	//3. Globally Unique Key
	//4. Alias Name
	KeyId string
}

func (d *DescribeKeyInfo) ActionName() string {
	return "DescribeKey"
}

type ListAliasesInfo struct {
	//These parameters are optional. See http://docs.aws.amazon.com/kms/latest/APIReference/API_ListAliases.html
	Limit  int    `json:",omitempty"`
	Marker string `json:",omitempty"`
}

func (l *ListAliasesInfo) ActionName() string {
	return "ListAliases"
}

type EncryptInfo struct {
	//4 forms for KeyId - http://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html
	//1. Key ARN
	//2. Alias ARN
	//3. Globally Unique Key
	//4. Alias Name
	KeyId string
	ProduceKeyOpt
	Plaintext []byte
}

func (e *EncryptInfo) ActionName() string {
	return "Encrypt"
}

type DecryptInfo struct {
	CiphertextBlob []byte
	ProduceKeyOpt
}

func (d *DecryptInfo) ActionName() string {
	return "Decrypt"
}

type EnableKeyInfo struct {
	//2 forms for KeyId - http://docs.aws.amazon.com/kms/latest/APIReference/API_EnableKey.html
	//1. Key ARN
	//2. Globally Unique Key
	KeyId string
}

func (e *EnableKeyInfo) ActionName() string {
	return "EnableKey"
}

type DisableKeyInfo struct {
	//2 forms for KeyId - http://docs.aws.amazon.com/kms/latest/APIReference/API_DisableKey.html
	//1. Key ARN
	//2. Globally Unique KeyId
	KeyId string
}

func (d *DisableKeyInfo) ActionName() string {
	return "DisableKey"
}