Documentation
¶
Index ¶
- Variables
- type AccountDirectory
- type AccountInfo
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AccountID() string
- func (b *InMemoryBackend) CreateLink(ctx context.Context, in LinkInput) (*Link, error)
- func (b *InMemoryBackend) CreateSink(ctx context.Context, name string, tagMap map[string]string) (*Sink, error)
- func (b *InMemoryBackend) DeleteLink(ctx context.Context, identifier string) error
- func (b *InMemoryBackend) DeleteSink(ctx context.Context, identifier string) error
- func (b *InMemoryBackend) GetLink(ctx context.Context, identifier string) (*Link, error)
- func (b *InMemoryBackend) GetSink(ctx context.Context, identifier string) (*Sink, error)
- func (b *InMemoryBackend) GetSinkPolicy(ctx context.Context, identifier string) (*Sink, error)
- func (b *InMemoryBackend) ListAttachedLinks(ctx context.Context, sinkIdentifier, token string, maxResults *int32) (page.Page[*Link], error)
- func (b *InMemoryBackend) ListLinks(ctx context.Context, token string, maxResults *int32) (page.Page[*Link], error)
- func (b *InMemoryBackend) ListSinks(ctx context.Context, token string, maxResults *int32) (page.Page[*Sink], error)
- func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resource string) (map[string]string, error)
- func (b *InMemoryBackend) PutSinkPolicy(ctx context.Context, identifier, policy string) (*Sink, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SetAccountDirectory(d AccountDirectory)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TagResource(ctx context.Context, resource string, add map[string]string) error
- func (b *InMemoryBackend) UntagResource(ctx context.Context, resource string, keys []string) error
- func (b *InMemoryBackend) UpdateLink(ctx context.Context, identifier string, resourceTypes []string, ...) (*Link, error)
- type Link
- type LinkConfig
- type LinkInput
- type Provider
- type Sink
Constants ¶
This section is empty.
Variables ¶
var ( ErrConflict = errors.New("conflict") ErrInvalidParameter = errors.New("invalid parameter") ErrMissingParameter = errors.New("missing required parameter") ErrResourceNotFound = errors.New("resource not found") ErrServiceQuotaExceeded = errors.New("service quota exceeded") ErrTooManyTags = errors.New("too many tags") )
Sentinels, one per exception in the pinned SDK's error set.
Functions ¶
This section is empty.
Types ¶
type AccountDirectory ¶
type AccountDirectory interface {
AccountInfo(accountID string) (AccountInfo, bool)
}
AccountDirectory resolves account details from the organization, when one is wired.
type AccountInfo ¶
AccountInfo describes an account for link labels and sink policy conditions.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
// contains filtered or unexported fields
}
Handler serves the CloudWatch Observability Access Manager REST-JSON API.
func (*Handler) ChaosOperations ¶
ChaosOperations returns the fault-injectable operations.
func (*Handler) ChaosRegions ¶
ChaosRegions returns the regions served.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase service name for fault rules.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name for metrics.
func (*Handler) ExtractResource ¶
ExtractResource returns the ARN label for metrics.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations lists every implemented operation.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher matches by SigV4 signing name (or SDK user agent) plus a known path shape.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the OAM state; one coarse lock guards both tables.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates an empty backend.
func (*InMemoryBackend) AccountID ¶
func (b *InMemoryBackend) AccountID() string
AccountID returns the default account.
func (*InMemoryBackend) CreateLink ¶
CreateLink links the caller's account and Region to a sink, subject to the sink policy.
func (*InMemoryBackend) CreateSink ¶
func (b *InMemoryBackend) CreateSink(ctx context.Context, name string, tagMap map[string]string) (*Sink, error)
CreateSink creates a sink in the caller's account and Region.
func (*InMemoryBackend) DeleteLink ¶
func (b *InMemoryBackend) DeleteLink(ctx context.Context, identifier string) error
DeleteLink removes a link.
func (*InMemoryBackend) DeleteSink ¶
func (b *InMemoryBackend) DeleteSink(ctx context.Context, identifier string) error
DeleteSink deletes a sink that has no links.
func (*InMemoryBackend) GetSinkPolicy ¶
GetSinkPolicy returns the sink and its policy.
func (*InMemoryBackend) ListAttachedLinks ¶
func (b *InMemoryBackend) ListAttachedLinks( ctx context.Context, sinkIdentifier, token string, maxResults *int32, ) (page.Page[*Link], error)
ListAttachedLinks returns the links attached to one of the caller's sinks.
func (*InMemoryBackend) ListLinks ¶
func (b *InMemoryBackend) ListLinks(ctx context.Context, token string, maxResults *int32) (page.Page[*Link], error)
ListLinks returns the caller's links in creation order.
func (*InMemoryBackend) ListSinks ¶
func (b *InMemoryBackend) ListSinks(ctx context.Context, token string, maxResults *int32) (page.Page[*Sink], error)
ListSinks returns the caller's sinks in creation order.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resource string) (map[string]string, error)
ListTagsForResource returns the tags of a sink or link.
func (*InMemoryBackend) PutSinkPolicy ¶
func (b *InMemoryBackend) PutSinkPolicy(ctx context.Context, identifier, policy string) (*Sink, error)
PutSinkPolicy sets the sink policy.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the default region.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads a snapshot; an incompatible version is discarded.
func (*InMemoryBackend) SetAccountDirectory ¶
func (b *InMemoryBackend) SetAccountDirectory(d AccountDirectory)
SetAccountDirectory wires the Organizations lookup.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(ctx context.Context, resource string, add map[string]string) error
TagResource adds or replaces tags on a sink or link.
func (*InMemoryBackend) UntagResource ¶
UntagResource removes tags by key.
func (*InMemoryBackend) UpdateLink ¶
func (b *InMemoryBackend) UpdateLink( ctx context.Context, identifier string, resourceTypes []string, cfg *LinkConfig, ) (*Link, error)
UpdateLink replaces a link's resource types and, when given, its filters.
type Link ¶
type Link struct {
Tags map[string]string `json:"tags,omitempty"`
LogGroupFilter *string `json:"logGroupFilter,omitempty"`
MetricFilter *string `json:"metricFilter,omitempty"`
ARN string `json:"arn"`
ID string `json:"id"`
Label string `json:"label"`
LabelTemplate string `json:"labelTemplate"`
SinkARN string `json:"sinkArn"`
Account string `json:"account"`
Region string `json:"region"`
ResourceTypes []string `json:"resourceTypes"`
Seq int64 `json:"seq"`
}
Link is a source-account link to a sink.
type LinkConfig ¶
LinkConfig is the optional filter set of a link.
type LinkInput ¶
type LinkInput struct {
Config LinkConfig
Tags map[string]string
SinkARN string
LabelTemplate string
ResourceTypes []string
}
LinkInput carries the editable fields of CreateLink.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for CloudWatch Observability Access Manager.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init builds the backend and handler.
type Sink ¶
type Sink struct {
Tags map[string]string `json:"tags,omitempty"`
ARN string `json:"arn"`
ID string `json:"id"`
Name string `json:"name"`
Account string `json:"account"`
Region string `json:"region"`
Policy string `json:"policy,omitempty"`
Seq int64 `json:"seq"`
HasPolicy bool `json:"hasPolicy,omitempty"`
}
Sink is a monitoring-account sink.