(ctx context.Context, bs blobserver.StatReceiver, br blob.Ref, s string)
| 138 | } |
| 139 | |
| 140 | func uploadString(ctx context.Context, bs blobserver.StatReceiver, br blob.Ref, s string) (blob.Ref, error) { |
| 141 | if !br.Valid() { |
| 142 | panic("invalid blobref") |
| 143 | } |
| 144 | hasIt, err := serverHasBlob(ctx, bs, br) |
| 145 | if err != nil { |
| 146 | return blob.Ref{}, err |
| 147 | } |
| 148 | if hasIt { |
| 149 | return br, nil |
| 150 | } |
| 151 | _, err = blobserver.ReceiveNoHash(ctx, bs, br, strings.NewReader(s)) |
| 152 | if err != nil { |
| 153 | return blob.Ref{}, err |
| 154 | } |
| 155 | return br, nil |
| 156 | } |
| 157 | |
| 158 | // uploadBytes populates bb (a builder of either type "bytes" or |
| 159 | // "file", which is a superset of "bytes"), sets it to the provided |
no test coverage detected