walla

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package walla holds types for the on-wire data from Wallabag. As these types tend to not match with Go idioms (mainly: int as booleans, a non-standard compliant time representation), we try to hide here.

Index

Constants

View Source
const TimeLayout = "2006-01-02T15:04:05-0700"

TimeLayout is the original wallabag time layout.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	SchemaVersion string  `json:"annotator_schema_version"`
	CreatedAt     Time    `json:"created_at"`
	ID            int     `json:"id"`
	Quote         string  `json:"quote"`
	Ranges        []Range `json:"ranges"`
	Text          string  `json:"text"`
	UpdatedAt     Time    `json:"updated_at"`

	User string `json:"user"` // User is only present in the GET entries call, but not in the GET anntotations/id call
}

Annotation represents one annotation made to an article

func (*Annotation) FromSako

func (a *Annotation) FromSako(sk sako.Annotation)

func (Annotation) ToSako

func (a Annotation) ToSako() (sk sako.Annotation)

type Annotations

type Annotations struct {
	Rows  []Annotation `json:"rows"`
	Total int          `json:"total"`
}

type Client

type Client struct {
	ID     string `json:"client_id"`
	Secret string `json:"client_secret"`
	Name   string `json:"name"`
}

func (*Client) FromSako

func (cli *Client) FromSako(sk sako.ClientAuth)

func (Client) ToSako

func (cli Client) ToSako() sako.ClientAuth

type Entries

type Entries struct {
	Page     int64 `json:"page"`
	Limit    int64 `json:"limit"`
	Pages    int64 `json:"pages"`
	Total    int64 `json:"total"`
	Links    Links `json:"_links"`
	Embedded struct {
		Items []Entry `json:"items"`
	} `json:"_embedded"`
}
func (es *Entries) SetupEntriesLinks(ep string, self *sako.Filter)
func (es *Entries) SetupSearchLinks(ep string, self *sako.Search)

type Entry

type Entry struct {
	Links          Links        `json:"_links"`
	Annotations    []Annotation `json:"annotations"`
	ArchivedAt     Time         `json:"archived_at"`
	CreatedAt      Time         `json:"created_at"`
	Content        string       `json:"content"`
	DomainName     string       `json:"domain_name"`
	GivenURL       string       `json:"given_url"`
	HashedGivenURL string       `json:"hashed_given_url"`
	HashedURL      string       `json:"hashed_url"`
	ID             int64        `json:"id"`
	IsArchived     int          `json:"is_archived"`
	IsPublic       bool         `json:"is_public"`
	IsStarred      int          `json:"is_starred"`
	Language       string       `json:"language"`
	Mimetype       string       `json:"mimetype"`
	OriginURL      string       `json:"origin_url"`
	PreviewPicture string       `json:"preview_picture"`
	PublishedAt    Time         `json:"published_at"`
	PublishedBy    []string     `json:"published_by"`
	ReadingTime    int          `json:"reading_time"`
	StarredAt      Time         `json:"starred_at"`
	Tags           []Tag        `json:"tags"`
	Title          string       `json:"title"`
	UID            string       `json:"uid"`
	UpdatedAt      Time         `json:"updated_at"`
	URL            string       `json:"url"`
	UserEmail      string       `json:"user_email"`
	UserID         int          `json:"user_id"`
	UserName       string       `json:"user_name"`
}

func (*Entry) FromSako

func (e *Entry) FromSako(sk sako.Entry)

func (Entry) ToSako

func (e Entry) ToSako() sako.Entry
type Link struct {
	Href string `json:"href"`
}
type Links struct {
	Self  *Link `json:"self,omitempty"`
	First *Link `json:"first,omitempty"`
	Last  *Link `json:"last,omitempty"`
	Next  *Link `json:"next,omitempty"`
}

type Range

type Range struct {
	End         string      `json:"end"`
	EndOffset   json.Number `json:"endOffset"`
	Start       string      `json:"start"`
	StartOffset json.Number `json:"startOffset"`
}

func (*Range) FromSako

func (o *Range) FromSako(r sako.Range)

func (Range) ToSako

func (r Range) ToSako() sako.Range

type Tag

type Tag struct {
	ID    int    `json:"id"`
	Label string `json:"label"`
	Slug  string `json:"slug"`
}

func (*Tag) FromSako

func (tag *Tag) FromSako(sk sako.Tag)

func (Tag) ToSako

func (tag Tag) ToSako() sako.Tag

type TaggingRule

type TaggingRule = sako.TaggingRule

type Time

type Time struct {
	time.Time
}

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(buf []byte) error

type Token

type Token struct {
	AccessToken  string `json:"access_token"`
	Expires      int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	Scope        string `json:"scope"`
	TokenType    string `json:"token_type"`
}

Token holds authentication informations.

func (*Token) FromSako added in v0.2.0

func (tok *Token) FromSako(sk sako.Token)

func (Token) ToSako added in v0.2.0

func (tok Token) ToSako() sako.Token

type User

type User struct {
	ID        int    `json:"id"`
	Username  string `json:"username"`
	Email     string `json:"email"`
	Name      string `json:"name"`
	CreatedAt Time   `json:"created_at"`
	UpdatedAt Time   `json:"updated_at"`
	Client    Client `json:"default_client,omit_empty"`
}

func (*User) FromSako

func (usr *User) FromSako(sk sako.User)

func (User) ToSako

func (usr User) ToSako() sako.User

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL