services

package
v0.0.0-...-422bf93 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScheduleStatusQueued    = "QUEUED"
	ScheduleStatusSucceeded = "SUCCEEDED"
	ScheduleStatusFailed    = "FAILED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Request(context.Context, *RequestInput) *ResponseOutput
}

type Database

type Database struct {
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(dynamodb dynamodbiface.DynamoDBAPI) *Database

func (*Database) Update

func (srv *Database) Update(ctx context.Context, inputs []*UpdateInput) error

type HttpClient

type HttpClient struct {
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient(c *http.Client) *HttpClient

func (*HttpClient) Request

func (hc *HttpClient) Request(
	ctx context.Context,
	ri *RequestInput) *ResponseOutput

type RequestInput

type RequestInput struct {
	URL     string
	Method  string
	Headers map[string]string
	Body    string
}

func CreateRequestInput

func CreateRequestInput(
	attributes map[string]events.DynamoDBAttributeValue) *RequestInput

type ResponseOutput

type ResponseOutput struct {
	Status string
	Result string
}

type Storage

type Storage interface {
	Update(context.Context, []*UpdateInput) error
}

type UpdateInput

type UpdateInput struct {
	ID          string            `dynamodbav:"id"`
	DueAt       int64             `dynamodbav:"dueAt"`
	URL         string            `dynamodbav:"url"`
	Method      string            `dynamodbav:"method"`
	Headers     map[string]string `dynamodbav:"headers,omitempty"`
	Body        *string           `dynamodbav:"body,omitempty"`
	StartedAt   *int64            `dynamodbav:"startedAt"`
	CompletedAt *int64            `dynamodbav:"completedAt"`
	Status      string            `dynamodbav:"status"`
	Result      *string           `dynamodbav:"result"`
	CreatedAt   int64             `dynamodbav:"createdAt"`
}

func CreateUpdateInput

func CreateUpdateInput(
	attributes map[string]events.DynamoDBAttributeValue) *UpdateInput

Jump to

Keyboard shortcuts

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