Skip to content

Instantly share code, notes, and snippets.

@bxcodec
Last active June 9, 2017 02:25
Show Gist options
  • Save bxcodec/e49a92334c7755b5aaa1547d80e0c769 to your computer and use it in GitHub Desktop.
Save bxcodec/e49a92334c7755b5aaa1547d80e0c769 to your computer and use it in GitHub Desktop.
Article fbs Flatbuffer
namespace articles;
table Image {
url: string ;
mime : string ;
width : int ;
height : int ;
}
table Content {
type :string;
}
table Paragraph{
base: Content;
text: string;
}
table ImageContent {
base: Content;
url: string ;
mime: string ;
width:int ;
height: int ;
}
union ContentUnion {ImageContent,Paragraph }
table ContentContainer {
contents: ContentUnion;
}
table Article {
id : long ;
title: string;
excerpt: string ;
html: string;
content : [ContentContainer];
url : string;
images : [Image];
publish_time: string ;
categories : [long];
source_id : long ;
}
root_type Article;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment