syncapi

package
v0.0.0-...-da001d4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2017 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREDENTIALS_CACHE_TTL = time.Duration(24*60*60) * time.Second
	ASSERTION_OFFSET      = time.Duration(15) * time.Second
	ASSERTION_DURATION    = time.Duration(24*60*60) * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

func SetupRouter

func SetupRouter(r *mux.Router, config Config) (*Application, error)

func (*Application) HandleBookmarksRecent

func (app *Application) HandleBookmarksRecent(w http.ResponseWriter, r *http.Request)

func (*Application) HandleGetClients

func (app *Application) HandleGetClients(w http.ResponseWriter, r *http.Request)

func (*Application) HandleGetStorageCollection

func (app *Application) HandleGetStorageCollection(w http.ResponseWriter, r *http.Request)

func (*Application) HandleHistoryRecent

func (app *Application) HandleHistoryRecent(w http.ResponseWriter, r *http.Request)

func (*Application) HandlePostBookmarks

func (app *Application) HandlePostBookmarks(w http.ResponseWriter, r *http.Request)

func (*Application) HandlePostClientsTab

func (app *Application) HandlePostClientsTab(w http.ResponseWriter, r *http.Request)

func (*Application) HandleProfile

func (app *Application) HandleProfile(w http.ResponseWriter, r *http.Request)

func (*Application) HandleTabs

func (app *Application) HandleTabs(w http.ResponseWriter, r *http.Request)

type BookmarkPayload

type BookmarkPayload struct {
	Id         string   `json:"id"`
	Type       string   `json:"type"`
	ParentId   string   `json:"parentid"`
	ParentName string   `json:"parentName"`
	URL        string   `json:"bmkUri"`
	Tags       []string `json:"tags"`
	Title      string   `json:"title"`
	Children   []string `json:"children,omitempty"`
	Modified   float64  `json:"modified,omitempty"`
}

type BookmarkPayloads

type BookmarkPayloads []BookmarkPayload

func (BookmarkPayloads) Len

func (slice BookmarkPayloads) Len() int

func (BookmarkPayloads) Less

func (slice BookmarkPayloads) Less(i, j int) bool

func (BookmarkPayloads) Swap

func (slice BookmarkPayloads) Swap(i, j int)

type ClientCommand

type ClientCommand struct {
	Command string   `json:"command"`
	Args    []string `json:"args"`
}

type ClientPayload

type ClientPayload struct {
	Id        string          `json:"id"`
	Name      string          `json:"name"`
	Type      string          `json:"type"`
	Version   string          `json:"version"`
	Protocols []string        `json:"protocols"`
	Commands  []ClientCommand `json:"commands,omitempty"`
}

type Config

type Config struct {
}

func DefaultConfig

func DefaultConfig() Config

type Credentials

type Credentials struct {
	Email       string
	Password    string
	KeyA        []byte
	KeyB        []byte
	ApiEndpoint string
	ApiKeyId    string
	ApiKey      string
}

type CredentialsCache

type CredentialsCache struct {
	sync.Mutex
	Entries map[string]CredentialsCacheEntry
}

func NewCredentialsCache

func NewCredentialsCache(ttl time.Duration) *CredentialsCache

func (*CredentialsCache) Get

func (cc *CredentialsCache) Get(username, password string) (Credentials, bool)

func (*CredentialsCache) Put

func (cc *CredentialsCache) Put(credentials Credentials, duration time.Duration)

type CredentialsCacheEntry

type CredentialsCacheEntry struct {
	Credentials Credentials
	Expires     time.Time
}

func (*CredentialsCacheEntry) IsExpired

func (e *CredentialsCacheEntry) IsExpired() bool

type HistoryPayload

type HistoryPayload struct {
	Id     string         `json:"id"`
	URL    string         `json:"histUri"`
	Title  string         `json:"title"`
	Visits []HistoryVisit `json:"visits"`
}

type HistoryPayloads

type HistoryPayloads []HistoryPayload

func (HistoryPayloads) Len

func (slice HistoryPayloads) Len() int

func (HistoryPayloads) Less

func (slice HistoryPayloads) Less(i, j int) bool

func (HistoryPayloads) Swap

func (slice HistoryPayloads) Swap(i, j int)

type HistoryVisit

type HistoryVisit struct {
	Date int `json:"date"`
	Type int `json:"type"`
}

type PostBookmarkRequest

type PostBookmarkRequest struct {
	Title string `json:"title"`
	URL   string `json:"url"`
}

type PostClientTabRequest

type PostClientTabRequest struct {
	Title string `json:"title"`
	URL   string `json:"url"`
}

type ProfileResponse

type ProfileResponse struct {
	Email  string `json:"email"`
	Name   string `json:"name"`
	Avatar string `json:"avatar"`
}

type Tab

type Tab struct {
	Title      string   `json:"title"`
	URLHistory []string `json:"urlHistory"`
	Icon       string   `json:"icon"`
}

type TabsPayload

type TabsPayload struct {
	Id         string `json:"id"`
	ClientName string `json:"clientName"`
	Tabs       []Tab  `json:"tabs"`
}

Jump to

Keyboard shortcuts

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