Documentation ¶
Index ¶
- type ARN
- type ErrARNNotFound
- type ErrInvalidARN
- type ErrUnknownRegion
- type Event
- type GetObjectContext
- type Identity
- type Target
- type TargetID
- type TargetIDResult
- type TargetIDSet
- type TargetList
- func (list *TargetList) Add(targets ...Target) error
- func (list *TargetList) Empty() bool
- func (list *TargetList) List(region string) []ARN
- func (list *TargetList) Lookup(arnStr string) (Target, error)
- func (list *TargetList) Remove(targetIDSet TargetIDSet)
- func (list *TargetList) Send(event Event, id TargetID) (*http.Response, error)
- func (list *TargetList) Stats() TargetStats
- func (list *TargetList) TargetMap() map[TargetID]Target
- func (list *TargetList) Targets() []Target
- type TargetStat
- type TargetStats
- type UserRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ARN ¶
type ARN struct { TargetID // contains filtered or unexported fields }
ARN - SQS resource name representation.
type ErrARNNotFound ¶
type ErrARNNotFound struct {
ARN ARN
}
ErrARNNotFound - ARN not found error.
func (ErrARNNotFound) Error ¶
func (err ErrARNNotFound) Error() string
type ErrInvalidARN ¶
type ErrInvalidARN struct {
ARN string
}
ErrInvalidARN - invalid ARN error.
func (ErrInvalidARN) Error ¶
func (err ErrInvalidARN) Error() string
type ErrUnknownRegion ¶
type ErrUnknownRegion struct {
Region string
}
ErrUnknownRegion - unknown region error.
func (ErrUnknownRegion) Error ¶
func (err ErrUnknownRegion) Error() string
type Event ¶
type Event struct { ProtocolVersion string `json:"protocolVersion"` GetObjectContext *GetObjectContext `json:"getObjectContext"` UserIdentity Identity `json:"userIdentity"` UserRequest UserRequest `json:"userRequest"` }
Event represents lambda function event, this is undocumented in AWS S3. This structure bases itself on this structure but there is no binding.
{ "xAmzRequestId": "a2871150-1df5-4dc9-ad9f-3da283ca1bf3", "getObjectContext": { "outputRoute": "...", "outputToken": "...", "inputS3Url": "<presignedURL>" }, "configuration": { // not useful in MinIO "accessPointArn": "...", "supportingAccessPointArn": "...", "payload": "" }, "userRequest": { "url": "...", "headers": { "Host": "...", "X-Amz-Content-SHA256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" } }, "userIdentity": { "type": "IAMUser", "principalId": "AIDAJF5MO57RFXQCE5ZNC", "arn": "...", "accountId": "...", "accessKeyId": "AKIA3WNQJCXE2DYPAU7R" }, "protocolVersion": "1.00" }
type GetObjectContext ¶
type GetObjectContext struct { OutputRoute string `json:"outputRoute"` OutputToken string `json:"outputToken"` InputS3URL string `json:"inputS3Url"` }
GetObjectContext provides the necessary details to perform download of the object, and return back the processed response to the server.
type Identity ¶
type Identity struct { Type string `json:"type"` PrincipalID string `json:"principalId"` AccessKeyID string `json:"accessKeyId"` }
Identity represents access key who caused the event.
type Target ¶
type Target interface { ID() TargetID IsActive() (bool, error) Send(Event) (*http.Response, error) Stat() TargetStat Close() error }
Target - lambda target interface
type TargetID ¶
TargetID - holds identification and name strings of notification target.
func (TargetID) MarshalJSON ¶
MarshalJSON - encodes to JSON data.
func (*TargetID) UnmarshalJSON ¶
UnmarshalJSON - decodes JSON data.
type TargetIDResult ¶
type TargetIDResult struct { // ID where the remove or send were initiated. ID TargetID // Stores any error while removing a target or while sending an event. Err error }
TargetIDResult returns result of Remove/Send operation, sets err if any for the associated TargetID
type TargetIDSet ¶
type TargetIDSet map[TargetID]struct{}
TargetIDSet - Set representation of TargetIDs.
func NewTargetIDSet ¶
func NewTargetIDSet(targetIDs ...TargetID) TargetIDSet
NewTargetIDSet - creates new TargetID set with given TargetIDs.
func (TargetIDSet) Clone ¶
func (set TargetIDSet) Clone() TargetIDSet
Clone - returns copy of this set.
func (TargetIDSet) Difference ¶
func (set TargetIDSet) Difference(sset TargetIDSet) TargetIDSet
Difference - returns diffrence with given set as new set.
func (TargetIDSet) IsEmpty ¶
func (set TargetIDSet) IsEmpty() bool
IsEmpty returns true if the set is empty.
func (TargetIDSet) Union ¶
func (set TargetIDSet) Union(sset TargetIDSet) TargetIDSet
Union - returns union with given set as new set.
type TargetList ¶
TargetList - holds list of targets indexed by target ID.
func (*TargetList) Add ¶
func (list *TargetList) Add(targets ...Target) error
Add - adds unique target to target list.
func (*TargetList) Empty ¶
func (list *TargetList) Empty() bool
Empty returns true if targetList is empty.
func (*TargetList) List ¶
func (list *TargetList) List(region string) []ARN
List - returns available target IDs.
func (*TargetList) Lookup ¶
func (list *TargetList) Lookup(arnStr string) (Target, error)
Lookup - checks whether target by target ID exists is valid or not.
func (*TargetList) Remove ¶
func (list *TargetList) Remove(targetIDSet TargetIDSet)
Remove - closes and removes targets by given target IDs.
func (*TargetList) Stats ¶
func (list *TargetList) Stats() TargetStats
Stats returns stats for targets.
func (*TargetList) TargetMap ¶
func (list *TargetList) TargetMap() map[TargetID]Target
TargetMap - returns available targets.
type TargetStat ¶
type TargetStat struct { ID TargetID ActiveRequests int64 TotalRequests int64 FailedRequests int64 }
TargetStat is the stats of a single target.
type TargetStats ¶
type TargetStats struct {
TargetStats map[string]TargetStat
}
TargetStats is a collection of stats for multiple targets.
type UserRequest ¶
UserRequest user request headers