types

package
v0.0.0-...-b62883f Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HashLength = 7
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Alternative

type Alternative struct {
	Type  string
	Title string
	URL   string
}

type Alternatives

type Alternatives []Alternative

type AuthRequest

type AuthRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

AuthRequest ...

func NewAuthRequest

func NewAuthRequest(r io.Reader) (req AuthRequest, err error)

NewAuthRequest ...

type AuthResponse

type AuthResponse struct {
	Token string `json:"token"`
}

AuthResponse ...

func (AuthResponse) Bytes

func (res AuthResponse) Bytes() ([]byte, error)

Bytes ...

type ConversationRequest

type ConversationRequest struct {
	Hash string `json:"hash"`
	Page int    `json:"page"`
}

ConversationRequest ...

func NewConversationRequest

func NewConversationRequest(r io.Reader) (req ConversationRequest, err error)

NewConversationRequest ...

type ExternalProfileRequest

type ExternalProfileRequest struct {
	URL  string `json:"url"`
	Nick string `json:"nick"`
}

ExternalProfileRequest ...

func NewExternalProfileRequest

func NewExternalProfileRequest(r io.Reader) (req ExternalProfileRequest, err error)

NewExternalProfileRequest ...

type Feed

type Feed struct {
	Nick string
	URL  string
}

Feed is an single twtxt.txt feed with a cannonical Nickname and URL for the feed

func (Feed) String

func (f Feed) String() string

String implements the Stringer interface and returns the Feed represented as a twtxt.txt URI in the form @<nick url>

type Feeds

type Feeds map[Feed]bool

Feeds is a mappping of Feed to booleans used to ensure unique feeds

type FetchTwtsRequest

type FetchTwtsRequest struct {
	URL  string `json:"url"`
	Nick string `json:"nick"`
	Page int    `json:"page"`
}

FetchTwtsRequest ...

func NewFetchTwtsRequest

func NewFetchTwtsRequest(r io.Reader) (req FetchTwtsRequest, err error)

NewFetchTwtsRequest ...

type FollowRequest

type FollowRequest struct {
	Nick string `json:"nick"`
	URL  string `json:"url"`
}

FollowRequest ...

func NewFollowRequest

func NewFollowRequest(r io.Reader) (req FollowRequest, err error)

NewFollowRequest ...

type Link struct {
	Href string
	Rel  string
}
type Links []Link

type MuteRequest

type MuteRequest struct {
	Nick string `json:"nick"`
	URL  string `json:"url"`
}

MuteRequest ...

func NewMuteRequest

func NewMuteRequest(r io.Reader) (req MuteRequest, err error)

NewMuteRequest ...

type PagedRequest

type PagedRequest struct {
	Page int `json:"page"`
}

PagedRequest ...

func NewPagedRequest

func NewPagedRequest(r io.Reader) (req PagedRequest, err error)

NewPagedRequest ...

type PagedResponse

type PagedResponse struct {
	Twts  []Twt `json:"twts"`
	Pager PagerResponse
}

PagedResponse ...

func (PagedResponse) Bytes

func (res PagedResponse) Bytes() ([]byte, error)

Bytes ...

type PagerResponse

type PagerResponse struct {
	Current   int `json:"current_page"`
	MaxPages  int `json:"max_pages"`
	TotalTwts int `json:"total_twts"`
}

PagerResponse ...

type PostRequest

type PostRequest struct {
	PostAs string `json:"post_as"`
	Text   string `json:"text"`
}

PostRequest ...

func NewPostRequest

func NewPostRequest(r io.Reader) (req PostRequest, err error)

NewPostRequest ...

type Profile

type Profile struct {
	Type string

	Username string
	Tagline  string
	URL      string
	TwtURL   string
	BlogsURL string

	// `true` if the User viewing the Profile has muted this user/feed
	Muted bool

	// `true` if the User viewing the Profile has follows this user/feed
	Follows bool

	// `true` if user/feed follows the User viewing the Profile.
	FollowedBy bool

	Followers map[string]string
	Following map[string]string
}

Profile represents a user/feed profile

type ProfileResponse

type ProfileResponse struct {
	Profile      Profile      `json:"profile"`
	Links        Links        `json:"links"`
	Alternatives Alternatives `json:"alternatives"`
	Twter        Twter        `json:"twter"`
}

ProfileResponse ...

type RegisterRequest

type RegisterRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Email    string `json:"email"`
}

RegisterRequest ...

func NewRegisterRequest

func NewRegisterRequest(r io.Reader) (req RegisterRequest, err error)

NewRegisterRequest ...

type ReportRequest

type ReportRequest struct {
	Nick string `json:"nick"`
	URL  string `json:"url"`

	Name     string `json:"name"`
	Email    string `json:"email"`
	Category string `json:"subject"`
	Message  string `json:"message"`
}

ReportRequest ...

func NewReportRequest

func NewReportRequest(r io.Reader) (req ReportRequest, err error)

NewReportRequest ...

type SupportRequest

type SupportRequest struct {
	Name    string `json:"name"`
	Email   string `json:"email"`
	Subject string `json:"subject"`
	Message string `json:"message"`
}

SupportRequest ...

func NewSupportRequest

func NewSupportRequest(r io.Reader) (req SupportRequest, err error)

NewSupportRequest ...

type Twt

type Twt struct {
	Twter        Twter
	Text         string
	MarkdownText string
	Created      time.Time
	// contains filtered or unexported fields
}

Twt ...

func (Twt) Hash

func (twt Twt) Hash() string

Hash ...

func (Twt) IsZero

func (twt Twt) IsZero() bool

func (Twt) MarshalJSON

func (twt Twt) MarshalJSON() ([]byte, error)

func (Twt) Mentions

func (twt Twt) Mentions() []Twter

Mentions ...

func (Twt) Subject

func (twt Twt) Subject() string

Subject ...

func (Twt) Tags

func (twt Twt) Tags() []string

Tags ...

type TwtMap

type TwtMap map[string]Twt

TwtMap ...

type Twter

type Twter struct {
	Nick    string
	URL     string
	Avatar  string
	Tagline string
}

Twter ...

func (Twter) IsZero

func (twter Twter) IsZero() bool

func (Twter) MarshalJSON

func (twter Twter) MarshalJSON() ([]byte, error)

type Twts

type Twts []Twt

Twts typedef to be able to attach sort methods

func (Twts) Len

func (twts Twts) Len() int

func (Twts) Less

func (twts Twts) Less(i, j int) bool

func (Twts) Swap

func (twts Twts) Swap(i, j int)

func (Twts) Tags

func (twts Twts) Tags() map[string]int

Tags ...

type UnfollowRequest

type UnfollowRequest struct {
	Nick string `json:"nick"`
}

UnfollowRequest ...

func NewUnfollowRequest

func NewUnfollowRequest(r io.Reader) (req UnfollowRequest, err error)

NewUnfollowRequest ...

type UnmuteRequest

type UnmuteRequest struct {
	Nick string `json:"nick"`
}

UnmuteRequest ...

func NewUnmuteRequest

func NewUnmuteRequest(r io.Reader) (req UnmuteRequest, err error)

NewUnmuteRequest ...

Jump to

Keyboard shortcuts

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