webhook

package
v0.0.0-...-8f1e39b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GETAction    = "GET"
	PUTAction    = "PUT"
	DELETEAction = "DELETE"
)
View Source
const HookNumberOfRedirect = 20

HookNumberOfRedirect will contains the number of redirect that a hook can follow.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketHookBody

type BucketHookBody struct {
	Name       string `json:"name"`
	Region     string `json:"region"`
	S3Endpoint string `json:"s3Endpoint"`
	Key        string `json:"key"`
}

type GetInputMetadata

type GetInputMetadata struct {
	IfModifiedSince   *time.Time
	IfMatch           string
	IfNoneMatch       string
	IfUnmodifiedSince *time.Time
	Range             string
}

GetInputMetadata Get input metadata.

type GetInputMetadataHookBody

type GetInputMetadataHookBody struct {
	IfModifiedSince   string `json:"ifModifiedSince"`
	IfMatch           string `json:"ifMatch"`
	IfNoneMatch       string `json:"ifNoneMatch"`
	IfUnmodifiedSince string `json:"ifUnmodifiedSince"`
	Range             string `json:"range"`
}

type HookBody

type HookBody struct {
	InputMetadata  interface{}     `json:"inputMetadata,omitempty"`
	OutputMetadata interface{}     `json:"outputMetadata,omitempty"`
	Target         *TargetHookBody `json:"target"`
	Action         string          `json:"action"`
	RequestPath    string          `json:"requestPath"`
}

type Manager

type Manager interface {
	// ManageGETHooks will manage GET hooks.
	ManageGETHooks(ctx context.Context, targetKey, requestPath string, inputMetadata *GetInputMetadata, s3Metadata *S3Metadata)
	// ManageGETHooks will manage PUT hooks.
	ManagePUTHooks(ctx context.Context, targetKey, requestPath string, inputMetadata *PutInputMetadata, s3Metadata *S3Metadata)
	// ManageGETHooks will manage DELETE hooks.
	ManageDELETEHooks(ctx context.Context, targetKey, requestPath string, s3Metadata *S3Metadata)
	// Load will load all webhooks clients.
	Load() error
}

Manager client manager.

func NewManager

func NewManager(cfgManager config.Manager, metricsSvc metrics.Client) Manager

type OutputMetadataHookBody

type OutputMetadataHookBody struct {
	Bucket     string `json:"bucket"`
	Region     string `json:"region"`
	S3Endpoint string `json:"s3Endpoint,omitempty"`
	Key        string `json:"key"`
}

type PutInputMetadata

type PutInputMetadata struct {
	Filename    string
	ContentType string
	ContentSize int64
}

PutInputMetadata Put input metadata.

type PutInputMetadataHookBody

type PutInputMetadataHookBody struct {
	Filename    string `json:"filename"`
	ContentType string `json:"contentType"`
	ContentSize int64  `json:"contentSize"`
}

type S3Metadata

type S3Metadata struct {
	Bucket     string
	Region     string
	S3Endpoint string
	Key        string
}

S3Metadata S3 Metadata.

type TargetHookBody

type TargetHookBody struct {
	Name string `json:"name"`
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL