Esempio n. 1
0
func ExampleCodeCommit_DeleteRepository() {
	svc := codecommit.New(nil)

	params := &codecommit.DeleteRepositoryInput{
		RepositoryName: aws.String("RepositoryName"), // Required
	}
	resp, err := svc.DeleteRepository(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)
}
Esempio n. 2
0
func ExampleCodeCommit_GetBranch() {
	svc := codecommit.New(nil)

	params := &codecommit.GetBranchInput{
		BranchName:     aws.String("BranchName"),
		RepositoryName: aws.String("RepositoryName"),
	}
	resp, err := svc.GetBranch(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)
}
Esempio n. 3
0
func ExampleCodeCommit_ListRepositories() {
	svc := codecommit.New(nil)

	params := &codecommit.ListRepositoriesInput{
		NextToken: aws.String("NextToken"),
		Order:     aws.String("OrderEnum"),
		SortBy:    aws.String("SortByEnum"),
	}
	resp, err := svc.ListRepositories(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)
}
Esempio n. 4
0
func ExampleCodeCommit_BatchGetRepositories() {
	svc := codecommit.New(nil)

	params := &codecommit.BatchGetRepositoriesInput{
		RepositoryNames: []*string{ // Required
			aws.String("RepositoryName"), // Required
			// More values...
		},
	}
	resp, err := svc.BatchGetRepositories(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)
}
Esempio n. 5
0
func TestInterface(t *testing.T) {
	assert.Implements(t, (*codecommitiface.CodeCommitAPI)(nil), codecommit.New(nil))
}
Esempio n. 6
0
func init() {
	Before("@codecommit", func() {
		World["client"] = codecommit.New(nil)
	})
}