Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.5 kB · 48 lines
Go
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849// Code generated by glex; DO NOT EDIT.
// Lexicon schema: com.atproto.repo.uploadBlob
package comatproto
import ( "context" "io"
glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen")
type RepoUploadBlob_Output struct { LexiconTypeID string `json:"$type,omitempty"` Blob glex.Blob `json:"blob"`}
// RecordTypeID implements glex.Record.func (t *RepoUploadBlob_Output) RecordTypeID() string { return "com.atproto.repo.uploadBlob" }
func (t *RepoUploadBlob_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } // stamp $type on a copy so marshal never mutates the record cp := *t cp.LexiconTypeID = "com.atproto.repo.uploadBlob" return glex.MarshalCBOR(w, &cp)}
func (t *RepoUploadBlob_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// RepoUploadBlob calls the XRPC method "com.atproto.repo.uploadBlob".//// Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS.func RepoUploadBlob(ctx context.Context, c glex.LexClient, input io.Reader) (*RepoUploadBlob_Output, error) { var out RepoUploadBlob_Output
if err := c.LexDo(ctx, glex.Procedure, "*/*", "com.atproto.repo.uploadBlob", nil, input, &out); err != nil { return nil, err } return &out, nil}