mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
Conver to regular Go vendor + dep tool
This commit is contained in:
+4410
File diff suppressed because it is too large
Load Diff
+115
@@ -0,0 +1,115 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package sfn
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeActivityDoesNotExist for service response error code
|
||||
// "ActivityDoesNotExist".
|
||||
//
|
||||
// The specified activity does not exist.
|
||||
ErrCodeActivityDoesNotExist = "ActivityDoesNotExist"
|
||||
|
||||
// ErrCodeActivityLimitExceeded for service response error code
|
||||
// "ActivityLimitExceeded".
|
||||
//
|
||||
// The maximum number of activities has been reached. Existing activities must
|
||||
// be deleted before a new activity can be created.
|
||||
ErrCodeActivityLimitExceeded = "ActivityLimitExceeded"
|
||||
|
||||
// ErrCodeActivityWorkerLimitExceeded for service response error code
|
||||
// "ActivityWorkerLimitExceeded".
|
||||
//
|
||||
// The maximum number of workers concurrently polling for activity tasks has
|
||||
// been reached.
|
||||
ErrCodeActivityWorkerLimitExceeded = "ActivityWorkerLimitExceeded"
|
||||
|
||||
// ErrCodeExecutionAlreadyExists for service response error code
|
||||
// "ExecutionAlreadyExists".
|
||||
//
|
||||
// An execution with the same name already exists.
|
||||
ErrCodeExecutionAlreadyExists = "ExecutionAlreadyExists"
|
||||
|
||||
// ErrCodeExecutionDoesNotExist for service response error code
|
||||
// "ExecutionDoesNotExist".
|
||||
//
|
||||
// The specified execution does not exist.
|
||||
ErrCodeExecutionDoesNotExist = "ExecutionDoesNotExist"
|
||||
|
||||
// ErrCodeExecutionLimitExceeded for service response error code
|
||||
// "ExecutionLimitExceeded".
|
||||
//
|
||||
// The maximum number of running executions has been reached. Running executions
|
||||
// must end or be stopped before a new execution can be started.
|
||||
ErrCodeExecutionLimitExceeded = "ExecutionLimitExceeded"
|
||||
|
||||
// ErrCodeInvalidArn for service response error code
|
||||
// "InvalidArn".
|
||||
//
|
||||
// The provided Amazon Resource Name (ARN) is invalid.
|
||||
ErrCodeInvalidArn = "InvalidArn"
|
||||
|
||||
// ErrCodeInvalidDefinition for service response error code
|
||||
// "InvalidDefinition".
|
||||
//
|
||||
// The provided Amazon States Language definition is invalid.
|
||||
ErrCodeInvalidDefinition = "InvalidDefinition"
|
||||
|
||||
// ErrCodeInvalidExecutionInput for service response error code
|
||||
// "InvalidExecutionInput".
|
||||
//
|
||||
// The provided JSON input data is invalid.
|
||||
ErrCodeInvalidExecutionInput = "InvalidExecutionInput"
|
||||
|
||||
// ErrCodeInvalidName for service response error code
|
||||
// "InvalidName".
|
||||
//
|
||||
// The provided name is invalid.
|
||||
ErrCodeInvalidName = "InvalidName"
|
||||
|
||||
// ErrCodeInvalidOutput for service response error code
|
||||
// "InvalidOutput".
|
||||
//
|
||||
// The provided JSON output data is invalid.
|
||||
ErrCodeInvalidOutput = "InvalidOutput"
|
||||
|
||||
// ErrCodeInvalidToken for service response error code
|
||||
// "InvalidToken".
|
||||
//
|
||||
// The provided token is invalid.
|
||||
ErrCodeInvalidToken = "InvalidToken"
|
||||
|
||||
// ErrCodeStateMachineAlreadyExists for service response error code
|
||||
// "StateMachineAlreadyExists".
|
||||
//
|
||||
// A state machine with the same name but a different definition or role ARN
|
||||
// already exists.
|
||||
ErrCodeStateMachineAlreadyExists = "StateMachineAlreadyExists"
|
||||
|
||||
// ErrCodeStateMachineDeleting for service response error code
|
||||
// "StateMachineDeleting".
|
||||
//
|
||||
// The specified state machine is being deleted.
|
||||
ErrCodeStateMachineDeleting = "StateMachineDeleting"
|
||||
|
||||
// ErrCodeStateMachineDoesNotExist for service response error code
|
||||
// "StateMachineDoesNotExist".
|
||||
//
|
||||
// The specified state machine does not exist.
|
||||
ErrCodeStateMachineDoesNotExist = "StateMachineDoesNotExist"
|
||||
|
||||
// ErrCodeStateMachineLimitExceeded for service response error code
|
||||
// "StateMachineLimitExceeded".
|
||||
//
|
||||
// The maximum number of state machines has been reached. Existing state machines
|
||||
// must be deleted before a new state machine can be created.
|
||||
ErrCodeStateMachineLimitExceeded = "StateMachineLimitExceeded"
|
||||
|
||||
// ErrCodeTaskDoesNotExist for service response error code
|
||||
// "TaskDoesNotExist".
|
||||
ErrCodeTaskDoesNotExist = "TaskDoesNotExist"
|
||||
|
||||
// ErrCodeTaskTimedOut for service response error code
|
||||
// "TaskTimedOut".
|
||||
ErrCodeTaskTimedOut = "TaskTimedOut"
|
||||
)
|
||||
+391
@@ -0,0 +1,391 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package sfn_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/sfn"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleSFN_CreateActivity() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.CreateActivityInput{
|
||||
Name: aws.String("Name"), // Required
|
||||
}
|
||||
resp, err := svc.CreateActivity(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_CreateStateMachine() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.CreateStateMachineInput{
|
||||
Definition: aws.String("Definition"), // Required
|
||||
Name: aws.String("Name"), // Required
|
||||
RoleArn: aws.String("Arn"), // Required
|
||||
}
|
||||
resp, err := svc.CreateStateMachine(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_DeleteActivity() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.DeleteActivityInput{
|
||||
ActivityArn: aws.String("Arn"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteActivity(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_DeleteStateMachine() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.DeleteStateMachineInput{
|
||||
StateMachineArn: aws.String("Arn"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteStateMachine(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_DescribeActivity() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.DescribeActivityInput{
|
||||
ActivityArn: aws.String("Arn"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeActivity(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_DescribeExecution() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.DescribeExecutionInput{
|
||||
ExecutionArn: aws.String("Arn"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeExecution(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_DescribeStateMachine() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.DescribeStateMachineInput{
|
||||
StateMachineArn: aws.String("Arn"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeStateMachine(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_GetActivityTask() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.GetActivityTaskInput{
|
||||
ActivityArn: aws.String("Arn"), // Required
|
||||
WorkerName: aws.String("Name"),
|
||||
}
|
||||
resp, err := svc.GetActivityTask(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_GetExecutionHistory() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.GetExecutionHistoryInput{
|
||||
ExecutionArn: aws.String("Arn"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("PageToken"),
|
||||
ReverseOrder: aws.Bool(true),
|
||||
}
|
||||
resp, err := svc.GetExecutionHistory(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_ListActivities() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.ListActivitiesInput{
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("PageToken"),
|
||||
}
|
||||
resp, err := svc.ListActivities(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_ListExecutions() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.ListExecutionsInput{
|
||||
StateMachineArn: aws.String("Arn"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("PageToken"),
|
||||
StatusFilter: aws.String("ExecutionStatus"),
|
||||
}
|
||||
resp, err := svc.ListExecutions(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_ListStateMachines() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.ListStateMachinesInput{
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("PageToken"),
|
||||
}
|
||||
resp, err := svc.ListStateMachines(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_SendTaskFailure() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.SendTaskFailureInput{
|
||||
TaskToken: aws.String("TaskToken"), // Required
|
||||
Cause: aws.String("Cause"),
|
||||
Error: aws.String("Error"),
|
||||
}
|
||||
resp, err := svc.SendTaskFailure(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_SendTaskHeartbeat() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.SendTaskHeartbeatInput{
|
||||
TaskToken: aws.String("TaskToken"), // Required
|
||||
}
|
||||
resp, err := svc.SendTaskHeartbeat(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_SendTaskSuccess() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.SendTaskSuccessInput{
|
||||
Output: aws.String("Data"), // Required
|
||||
TaskToken: aws.String("TaskToken"), // Required
|
||||
}
|
||||
resp, err := svc.SendTaskSuccess(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_StartExecution() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.StartExecutionInput{
|
||||
StateMachineArn: aws.String("Arn"), // Required
|
||||
Input: aws.String("Data"),
|
||||
Name: aws.String("Name"),
|
||||
}
|
||||
resp, err := svc.StartExecution(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleSFN_StopExecution() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := sfn.New(sess)
|
||||
|
||||
params := &sfn.StopExecutionInput{
|
||||
ExecutionArn: aws.String("Arn"), // Required
|
||||
Cause: aws.String("Cause"),
|
||||
Error: aws.String("Error"),
|
||||
}
|
||||
resp, err := svc.StopExecution(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package sfn
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
|
||||
)
|
||||
|
||||
// AWS Step Functions is a web service that enables you to coordinate the components
|
||||
// of distributed applications and microservices using visual workflows. You
|
||||
// build applications from individual components that each perform a discrete
|
||||
// function, or task, allowing you to scale and change applications quickly.
|
||||
// Step Functions provides a graphical console to visualize the components of
|
||||
// your application as a series of steps. It automatically triggers and tracks
|
||||
// each step, and retries when there are errors, so your application executes
|
||||
// in order and as expected, every time. Step Functions logs the state of each
|
||||
// step, so when things do go wrong, you can diagnose and debug problems quickly.
|
||||
//
|
||||
// Step Functions manages the operations and underlying infrastructure for you
|
||||
// to ensure your application is available at any scale. You can run tasks on
|
||||
// the AWS cloud, on your own servers, or an any system that has access to AWS.
|
||||
// Step Functions can be accessed and used with the Step Functions console,
|
||||
// the AWS SDKs (included with your Beta release invitation email), or an HTTP
|
||||
// API (the subject of this document).
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23
|
||||
type SFN struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// Used for custom client initialization logic
|
||||
var initClient func(*client.Client)
|
||||
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "states" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the SFN client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
// aws.Config parameter to add your extra config.
|
||||
//
|
||||
// Example:
|
||||
// // Create a SFN client from just a session.
|
||||
// svc := sfn.New(mySession)
|
||||
//
|
||||
// // Create a SFN client with additional configuration
|
||||
// svc := sfn.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *SFN {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *SFN {
|
||||
svc := &SFN{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2016-11-23",
|
||||
JSONVersion: "1.0",
|
||||
TargetPrefix: "AWSStepFunctions",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a SFN operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *SFN) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
// Run custom request initialization if present
|
||||
if initRequest != nil {
|
||||
initRequest(req)
|
||||
}
|
||||
|
||||
return req
|
||||
}
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
// Package sfniface provides an interface to enable mocking the AWS Step Functions service client
|
||||
// for testing your code.
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters.
|
||||
package sfniface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/sfn"
|
||||
)
|
||||
|
||||
// SFNAPI provides an interface to enable mocking the
|
||||
// sfn.SFN service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // AWS Step Functions.
|
||||
// func myFunc(svc sfniface.SFNAPI) bool {
|
||||
// // Make svc.CreateActivity request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := sfn.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockSFNClient struct {
|
||||
// sfniface.SFNAPI
|
||||
// }
|
||||
// func (m *mockSFNClient) CreateActivity(input *sfn.CreateActivityInput) (*sfn.CreateActivityOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockSFNClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type SFNAPI interface {
|
||||
CreateActivity(*sfn.CreateActivityInput) (*sfn.CreateActivityOutput, error)
|
||||
CreateActivityWithContext(aws.Context, *sfn.CreateActivityInput, ...request.Option) (*sfn.CreateActivityOutput, error)
|
||||
CreateActivityRequest(*sfn.CreateActivityInput) (*request.Request, *sfn.CreateActivityOutput)
|
||||
|
||||
CreateStateMachine(*sfn.CreateStateMachineInput) (*sfn.CreateStateMachineOutput, error)
|
||||
CreateStateMachineWithContext(aws.Context, *sfn.CreateStateMachineInput, ...request.Option) (*sfn.CreateStateMachineOutput, error)
|
||||
CreateStateMachineRequest(*sfn.CreateStateMachineInput) (*request.Request, *sfn.CreateStateMachineOutput)
|
||||
|
||||
DeleteActivity(*sfn.DeleteActivityInput) (*sfn.DeleteActivityOutput, error)
|
||||
DeleteActivityWithContext(aws.Context, *sfn.DeleteActivityInput, ...request.Option) (*sfn.DeleteActivityOutput, error)
|
||||
DeleteActivityRequest(*sfn.DeleteActivityInput) (*request.Request, *sfn.DeleteActivityOutput)
|
||||
|
||||
DeleteStateMachine(*sfn.DeleteStateMachineInput) (*sfn.DeleteStateMachineOutput, error)
|
||||
DeleteStateMachineWithContext(aws.Context, *sfn.DeleteStateMachineInput, ...request.Option) (*sfn.DeleteStateMachineOutput, error)
|
||||
DeleteStateMachineRequest(*sfn.DeleteStateMachineInput) (*request.Request, *sfn.DeleteStateMachineOutput)
|
||||
|
||||
DescribeActivity(*sfn.DescribeActivityInput) (*sfn.DescribeActivityOutput, error)
|
||||
DescribeActivityWithContext(aws.Context, *sfn.DescribeActivityInput, ...request.Option) (*sfn.DescribeActivityOutput, error)
|
||||
DescribeActivityRequest(*sfn.DescribeActivityInput) (*request.Request, *sfn.DescribeActivityOutput)
|
||||
|
||||
DescribeExecution(*sfn.DescribeExecutionInput) (*sfn.DescribeExecutionOutput, error)
|
||||
DescribeExecutionWithContext(aws.Context, *sfn.DescribeExecutionInput, ...request.Option) (*sfn.DescribeExecutionOutput, error)
|
||||
DescribeExecutionRequest(*sfn.DescribeExecutionInput) (*request.Request, *sfn.DescribeExecutionOutput)
|
||||
|
||||
DescribeStateMachine(*sfn.DescribeStateMachineInput) (*sfn.DescribeStateMachineOutput, error)
|
||||
DescribeStateMachineWithContext(aws.Context, *sfn.DescribeStateMachineInput, ...request.Option) (*sfn.DescribeStateMachineOutput, error)
|
||||
DescribeStateMachineRequest(*sfn.DescribeStateMachineInput) (*request.Request, *sfn.DescribeStateMachineOutput)
|
||||
|
||||
GetActivityTask(*sfn.GetActivityTaskInput) (*sfn.GetActivityTaskOutput, error)
|
||||
GetActivityTaskWithContext(aws.Context, *sfn.GetActivityTaskInput, ...request.Option) (*sfn.GetActivityTaskOutput, error)
|
||||
GetActivityTaskRequest(*sfn.GetActivityTaskInput) (*request.Request, *sfn.GetActivityTaskOutput)
|
||||
|
||||
GetExecutionHistory(*sfn.GetExecutionHistoryInput) (*sfn.GetExecutionHistoryOutput, error)
|
||||
GetExecutionHistoryWithContext(aws.Context, *sfn.GetExecutionHistoryInput, ...request.Option) (*sfn.GetExecutionHistoryOutput, error)
|
||||
GetExecutionHistoryRequest(*sfn.GetExecutionHistoryInput) (*request.Request, *sfn.GetExecutionHistoryOutput)
|
||||
|
||||
GetExecutionHistoryPages(*sfn.GetExecutionHistoryInput, func(*sfn.GetExecutionHistoryOutput, bool) bool) error
|
||||
GetExecutionHistoryPagesWithContext(aws.Context, *sfn.GetExecutionHistoryInput, func(*sfn.GetExecutionHistoryOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListActivities(*sfn.ListActivitiesInput) (*sfn.ListActivitiesOutput, error)
|
||||
ListActivitiesWithContext(aws.Context, *sfn.ListActivitiesInput, ...request.Option) (*sfn.ListActivitiesOutput, error)
|
||||
ListActivitiesRequest(*sfn.ListActivitiesInput) (*request.Request, *sfn.ListActivitiesOutput)
|
||||
|
||||
ListActivitiesPages(*sfn.ListActivitiesInput, func(*sfn.ListActivitiesOutput, bool) bool) error
|
||||
ListActivitiesPagesWithContext(aws.Context, *sfn.ListActivitiesInput, func(*sfn.ListActivitiesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListExecutions(*sfn.ListExecutionsInput) (*sfn.ListExecutionsOutput, error)
|
||||
ListExecutionsWithContext(aws.Context, *sfn.ListExecutionsInput, ...request.Option) (*sfn.ListExecutionsOutput, error)
|
||||
ListExecutionsRequest(*sfn.ListExecutionsInput) (*request.Request, *sfn.ListExecutionsOutput)
|
||||
|
||||
ListExecutionsPages(*sfn.ListExecutionsInput, func(*sfn.ListExecutionsOutput, bool) bool) error
|
||||
ListExecutionsPagesWithContext(aws.Context, *sfn.ListExecutionsInput, func(*sfn.ListExecutionsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListStateMachines(*sfn.ListStateMachinesInput) (*sfn.ListStateMachinesOutput, error)
|
||||
ListStateMachinesWithContext(aws.Context, *sfn.ListStateMachinesInput, ...request.Option) (*sfn.ListStateMachinesOutput, error)
|
||||
ListStateMachinesRequest(*sfn.ListStateMachinesInput) (*request.Request, *sfn.ListStateMachinesOutput)
|
||||
|
||||
ListStateMachinesPages(*sfn.ListStateMachinesInput, func(*sfn.ListStateMachinesOutput, bool) bool) error
|
||||
ListStateMachinesPagesWithContext(aws.Context, *sfn.ListStateMachinesInput, func(*sfn.ListStateMachinesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
SendTaskFailure(*sfn.SendTaskFailureInput) (*sfn.SendTaskFailureOutput, error)
|
||||
SendTaskFailureWithContext(aws.Context, *sfn.SendTaskFailureInput, ...request.Option) (*sfn.SendTaskFailureOutput, error)
|
||||
SendTaskFailureRequest(*sfn.SendTaskFailureInput) (*request.Request, *sfn.SendTaskFailureOutput)
|
||||
|
||||
SendTaskHeartbeat(*sfn.SendTaskHeartbeatInput) (*sfn.SendTaskHeartbeatOutput, error)
|
||||
SendTaskHeartbeatWithContext(aws.Context, *sfn.SendTaskHeartbeatInput, ...request.Option) (*sfn.SendTaskHeartbeatOutput, error)
|
||||
SendTaskHeartbeatRequest(*sfn.SendTaskHeartbeatInput) (*request.Request, *sfn.SendTaskHeartbeatOutput)
|
||||
|
||||
SendTaskSuccess(*sfn.SendTaskSuccessInput) (*sfn.SendTaskSuccessOutput, error)
|
||||
SendTaskSuccessWithContext(aws.Context, *sfn.SendTaskSuccessInput, ...request.Option) (*sfn.SendTaskSuccessOutput, error)
|
||||
SendTaskSuccessRequest(*sfn.SendTaskSuccessInput) (*request.Request, *sfn.SendTaskSuccessOutput)
|
||||
|
||||
StartExecution(*sfn.StartExecutionInput) (*sfn.StartExecutionOutput, error)
|
||||
StartExecutionWithContext(aws.Context, *sfn.StartExecutionInput, ...request.Option) (*sfn.StartExecutionOutput, error)
|
||||
StartExecutionRequest(*sfn.StartExecutionInput) (*request.Request, *sfn.StartExecutionOutput)
|
||||
|
||||
StopExecution(*sfn.StopExecutionInput) (*sfn.StopExecutionOutput, error)
|
||||
StopExecutionWithContext(aws.Context, *sfn.StopExecutionInput, ...request.Option) (*sfn.StopExecutionOutput, error)
|
||||
StopExecutionRequest(*sfn.StopExecutionInput) (*request.Request, *sfn.StopExecutionOutput)
|
||||
}
|
||||
|
||||
var _ SFNAPI = (*sfn.SFN)(nil)
|
||||
Reference in New Issue
Block a user