Something went wrong. Try again.
Monorepo for Tangled forked from tangled.org/core
Something went wrong. Try again.
2.6 kB · 94 lines
Go
at master
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
package org_tangled
// schema: org.tangled.snippet.string
import ( "bytes" "encoding/json" "fmt" "io"
"github.com/bluesky-social/indigo/lex/util" cbg "github.com/whyrusleeping/cbor-gen")
const ( SnippetStringNSID = "org.tangled.snippet.string")
func init() { util.RegisterType("org.tangled.snippet.string", &SnippetString{})} //// RECORDTYPE: SnippetStringtype SnippetString struct { LexiconTypeID string `json:"$type,const=org.tangled.snippet.string" cborgen:"$type,const=org.tangled.snippet.string"` CreatedAt string `json:"createdAt" cborgen:"createdAt"` Description *string `json:"description,omitempty" cborgen:"description,omitempty"` Snippet *SnippetString_Snippet `json:"snippet" cborgen:"snippet"`}
type SnippetString_Snippet struct { SnippetString_TextFile *SnippetString_TextFile}
func (t *SnippetString_Snippet) MarshalJSON() ([]byte, error) { if t.SnippetString_TextFile != nil { t.SnippetString_TextFile.LexiconTypeID = "org.tangled.snippet.string#textFile" return json.Marshal(t.SnippetString_TextFile) } return nil, fmt.Errorf("cannot marshal empty enum")}func (t *SnippetString_Snippet) UnmarshalJSON(b []byte) error { typ, err := util.TypeExtract(b) if err != nil { return err }
switch typ { case "org.tangled.snippet.string#textFile": t.SnippetString_TextFile = new(SnippetString_TextFile) return json.Unmarshal(b, t.SnippetString_TextFile)
default: return nil }}
func (t *SnippetString_Snippet) MarshalCBOR(w io.Writer) error {
if t == nil { _, err := w.Write(cbg.CborNull) return err } if t.SnippetString_TextFile != nil { return t.SnippetString_TextFile.MarshalCBOR(w) } return fmt.Errorf("cannot cbor marshal empty enum")}func (t *SnippetString_Snippet) UnmarshalCBOR(r io.Reader) error { typ, b, err := util.CborTypeExtractReader(r) if err != nil { return err }
switch typ { case "org.tangled.snippet.string#textFile": t.SnippetString_TextFile = new(SnippetString_TextFile) return t.SnippetString_TextFile.UnmarshalCBOR(bytes.NewReader(b))
default: return nil }}
// SnippetString_TextFile is a "textFile" in the org.tangled.snippet.string schema.//// RECORDTYPE: SnippetString_TextFiletype SnippetString_TextFile struct { LexiconTypeID string `json:"$type,const=org.tangled.snippet.string#textFile" cborgen:"$type,const=org.tangled.snippet.string#textFile"` Content *util.LexBlob `json:"content" cborgen:"content"` // name: file name Name string `json:"name" cborgen:"name"`}