server

package
v0.0.0-...-59fde94 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: BSD-2-Clause Imports: 32 Imported by: 1

Documentation

Overview

Code generated for package server by go-bindata DO NOT EDIT. (@generated) sources: webroot/favicon.ico webroot/geekmarks.crx webroot/images/01_something_about_python.gif webroot/images/01_something_about_python_small.gif webroot/images/02_python_repl.gif webroot/images/02_python_repl_small.gif webroot/images/03_find.gif webroot/images/gm_menu_logged.png webroot/images/gm_menu_not_logged.png webroot/index.html webroot/index.js webroot/logo.js webroot/styles.css

Index

Constants

View Source
const (
	QSArgBkmGetArgTagID = "tag_id"
	QSArgBkmGetArgURL   = "url"
)
View Source
const (
	QSArgTagsShape       = "shape"
	QSArgTagsShapeTree   = "tree"
	QSArgTagsShapeFlat   = "flat"
	QSArgTagsShapeSingle = "single"

	QSArgTagsPattern = "pattern"

	QSArgTagsAllowNew = "allow_new"

	QSArgNewLeafPolicy     = "new_leaf_policy"
	QSArgNewLeafPolicyKeep = "keep"
	QSArgNewLeafPolicyDel  = "del"
)
View Source
const (
	BookmarkID = "bkmid"
)

Variables

View Source
var (
	ErrTagSuggestionFailed = errors.New("tag suggestion failed")
)

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type GMHandler

type GMHandler func(gmr *GMRequest) (resp interface{}, err error)

type GMRequest

type GMRequest struct {
	HttpReq  *http.Request
	SubjUser *storage.UserData
	Caller   *storage.UserData
	// TODO: remove Method from here, use HttpReq.Method instead
	//       (it is already populated correctly from websocket request)
	Method string
	Values map[string][]string
	Body   io.ReadCloser
}

func (*GMRequest) FormValue

func (gmr *GMRequest) FormValue(key string) string

type GMServer

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

func New

func New(si storage.Storage) (*GMServer, error)

func (*GMServer) CreateHandler

func (gm *GMServer) CreateHandler() (http.Handler, error)

type GoogleTokenInfo

type GoogleTokenInfo struct {
	// Audience: Who is the intended audience for this token. In general the
	// same as issued_to.
	Audience string `json:"audience,omitempty"`

	// Email: The email address of the user. Present only if the email scope
	// is present in the request.
	Email string `json:"email,omitempty"`

	// ExpiresIn: The expiry time of the token, as number of seconds left
	// until expiry.
	ExpiresIn int64 `json:"expires_in,omitempty"`

	// IssuedTo: To whom was the token issued to. In general the same as
	// audience.
	IssuedTo string `json:"issued_to,omitempty"`

	// UserID: The obfuscated user id.
	UserID string `json:"user_id,omitempty"`

	// VerifiedEmail: Boolean flag which is true if the email address is
	// verified. Present only if the email scope is present in the request.
	VerifiedEmail bool `json:"verified_email,omitempty"`

	// Returned in case of error.
	Error            string `json:"error,omitempty"`
	ErrorDescription string `json:"error_description,omitempty"`
}

type OAuthCreds

type OAuthCreds struct {
	ClientID     string `yaml:"client_id"`
	ClientSecret string `yaml:"client_secret"`
}

func ReadOAuthCredsFile

func ReadOAuthCredsFile(credsFile string) (*OAuthCreds, error)

type WebSocketMux

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

func (*WebSocketMux) Add

func (m *WebSocketMux) Add(pattern *pat.Pattern, handler GMHandler)

func (*WebSocketMux) Handle

func (m *WebSocketMux) Handle(gmr *GMRequest) (resp interface{}, err error)

type WebSocketRequest

type WebSocketRequest struct {
	Id     int    `json:"id"`
	Method string `json:"method"`
	// Path after user address: e.g. the replica of "/api/my/tags" is "/tags".
	Path   string                 `json:"path"`
	Values map[string]interface{} `json:"values"`
	Body   interface{}            `json:"body,omitempty"`
}

type WebSocketResponse

type WebSocketResponse struct {
	Id     int    `json:"id"`
	Method string `json:"method"`
	// Path after user address: e.g. the replica of "/api/my/tags" is "/tags".
	Path   string                 `json:"path"`
	Values map[string]interface{} `json:"values,omitempty"`
	Status int                    `json:"status"`
	Body   interface{}            `json:"body"`
}

Jump to

Keyboard shortcuts

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