types.go
changeset 17 9f17ef336aad
parent 16 9d64e00d3ea6
child 18 cc25503a10b6
equal deleted inserted replaced
16:9d64e00d3ea6 17:9f17ef336aad
     1 package gondole
     1 package gondole
     2 
     2 
     3 import "time"
     3 import (
       
     4 	"github.com/urfave/cli"
       
     5 	"gopkg.in/asn1-ber.v1"
       
     6 	"net/textproto"
       
     7 	"time"
       
     8 )
     4 
     9 
     5 type Gondole struct {
    10 type Gondole struct {
     6 	Name string
    11 	Name        string
     7     RedirectURI string
    12 	RedirectURI string
     8 }
       
     9 
       
    10 type Account struct {
       
    11 	ID         int
       
    12 	Acct       string
       
    13 	Avatar     string
       
    14 	Followers  int
       
    15 	Followings int
       
    16 	Header     string
       
    17 	Note       string
       
    18 	Statuses   int
       
    19 	URL        string
       
    20 	Username   string
       
    21 }
    13 }
    22 
    14 
    23 type Client struct {
    15 type Client struct {
    24 	BaseURL     string
    16 	BaseURL     string
    25 	BearerToken string
    17 	BearerToken string
    26 }
    18 }
    27 
    19 
       
    20 /*
       
    21 
       
    22 Entities:
       
    23 
       
    24 Everything manipulated/returned by the API
       
    25 */
       
    26 
       
    27 type Account struct {
       
    28 	ID          int
       
    29 	Username    string
       
    30 	Acct        string
       
    31 	DisplayName string
       
    32 	Note        string
       
    33 	URL         string
       
    34 	Avatar      string
       
    35 	Header      string
       
    36 	Locked      bool
       
    37 	Followers   int
       
    38 	Followings  int
       
    39 	Statuses    int
       
    40 }
       
    41 
       
    42 type Application struct {
       
    43 	Name    string
       
    44 	Website string
       
    45 }
       
    46 
       
    47 type Attachement struct {
       
    48 	ID         int
       
    49 	Type       string
       
    50 	URL        string
       
    51 	RemoteURL  string
       
    52 	PreviewURL string
       
    53 	TextURL    string
       
    54 }
       
    55 
       
    56 type Card struct {
       
    57 	URL         string
       
    58 	Title       string
       
    59 	Description string
       
    60 	Image       string
       
    61 }
       
    62 
       
    63 type Context struct {
       
    64 	Ancestors   []Status
       
    65 	Descendents []Status
       
    66 }
       
    67 
       
    68 type Error struct {
       
    69 	Text string
       
    70 }
       
    71 
       
    72 type Instance struct {
       
    73 	URI         string
       
    74 	Title       string
       
    75 	Description string
       
    76 	Email       string
       
    77 }
       
    78 
       
    79 type Mention struct {
       
    80 	ID       int
       
    81 	URL      string
       
    82 	Username string
       
    83 	Acct     string
       
    84 }
       
    85 
       
    86 type Notification struct {
       
    87 	ID        int
       
    88 	Type      string
       
    89 	CreatedAt time.Time
       
    90 	Account   *Account
       
    91 	Status    *Status
       
    92 }
       
    93 
       
    94 type Relationship struct {
       
    95 	Following  bool
       
    96 	FollowedBy bool
       
    97 	Blocking   bool
       
    98 	Muting     bool
       
    99 	Requested  bool
       
   100 }
       
   101 type Report struct {
       
   102 	ID          int
       
   103 	ActionTaken string
       
   104 }
       
   105 
       
   106 type Result struct {
       
   107 	Accounts []Account
       
   108 	Statutes []Status
       
   109 	Hashtags []Tag
       
   110 }
       
   111 
    28 type Status struct {
   112 type Status struct {
    29 	ID         int
   113 	ID                 int
    30 	Account    *Account
   114 	URI                string
    31 	Content    string
   115 	URL                string
    32 	CreatedAT  time.Time
   116 	Account            *Account
    33 	Favourited bool
   117 	InReplyToId        int
    34 	Favourites int
   118 	InReplyToAccountID int
    35 	InReplyTo  int
   119 	Reblog             *Status
    36 	Reblog     *Status
   120 	Content            string
    37 	Reblogged  bool
   121 	CreatedAT          time.Time
    38 	Reblogs    int
   122 	Reblogs            int
    39 	URI        string
   123 	Favourites         int
    40 	URL        string
   124 	Reblogged          bool
       
   125 	Favourited         bool
       
   126 	Sensitive          bool
       
   127 	SpoilerText        string
       
   128 	Visibility         string
       
   129 	MediaAttachments   []Attachement
       
   130 	Mentions           []Mention
       
   131 	Tags               []Tag
       
   132 	App                Application
    41 }
   133 }
       
   134 
       
   135 type Tag struct {
       
   136 	Name string
       
   137 	URL  string
       
   138 }