mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-05 13:08:07 +00:00
Bump Deps (#4868)
* bump deps * revert script changes * adding govendor miss
This commit is contained in:
20
vendor/github.com/google/go-github/github/git_blobs.go
generated
vendored
20
vendor/github.com/google/go-github/github/git_blobs.go
generated
vendored
@@ -6,6 +6,7 @@
|
||||
package github
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
)
|
||||
@@ -20,7 +21,7 @@ type Blob struct {
|
||||
NodeID *string `json:"node_id,omitempty"`
|
||||
}
|
||||
|
||||
// GetBlob fetchs a blob from a repo given a SHA.
|
||||
// GetBlob fetches a blob from a repo given a SHA.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/git/blobs/#get-a-blob
|
||||
func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha string) (*Blob, *Response, error) {
|
||||
@@ -38,6 +39,23 @@ func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha
|
||||
return blob, resp, err
|
||||
}
|
||||
|
||||
// GetBlobRaw fetches a blob's contents from a repo.
|
||||
// Unlike GetBlob, it returns the raw bytes rather than the base64-encoded data.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/git/blobs/#get-a-blob
|
||||
func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([]byte, *Response, error) {
|
||||
u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha)
|
||||
req, err := s.client.NewRequest("GET", u, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
req.Header.Set("Accept", "application/vnd.github.v3.raw")
|
||||
|
||||
var buf bytes.Buffer
|
||||
resp, err := s.client.Do(ctx, req, &buf)
|
||||
return buf.Bytes(), resp, err
|
||||
}
|
||||
|
||||
// CreateBlob creates a blob object.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/v3/git/blobs/#create-a-blob
|
||||
|
||||
Reference in New Issue
Block a user