utility

package
v0.0.0-...-d340c60 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrivateKey

func GetPrivateKey(ctx context.Context) (*ecdsa.PrivateKey, error)

GetPrivateKey は秘密鍵を取得する

func GetPublicKey

func GetPublicKey(ctx context.Context) (*ecdsa.PublicKey, error)

GetPublicKey は公開鍵を取得する

func KeyHandler

func KeyHandler(w http.ResponseWriter, r *http.Request)

KeyHandler は公開鍵を返却する

func SearchHandler

func SearchHandler(w http.ResponseWriter, r *http.Request)

SearchHandler はWeb検索を行い結果を返す

func TunnelHandler

func TunnelHandler(w http.ResponseWriter, r *http.Request)

TunnelHandler はhttpで提供されているコンテンツにアクセスするためのproxy機能

Types

type ExURL

type ExURL string

ExURL は拡張URL型

func (ExURL) MarshalJSON

func (e ExURL) MarshalJSON() ([]byte, error)

MarshalJSON は拡張ExURLをJSON出力する

func (ExURL) TunneledURL

func (e ExURL) TunneledURL() string

TunneledURL はproxyされたURLを返却する

type HTML

type HTML struct {
	FeedURL  string
	ImageURL string
	IconURL  string
}

HTML はhtmlから取得できる情報を持つ

func ParseHTML

func ParseHTML(ctx context.Context, url string) (HTML, error)

ParseHTML はurlで取得したHTMLを解析して 中に含まれる情報を返す

type Property

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

Property はデフォルト値を持つプロパティ 値はdatastoreに持つ.

func NewFromContext

func NewFromContext(ctx context.Context) *Property

NewFromContext はコンテキストを元にPropertyを作成する

func (*Property) GetInt64

func (p *Property) GetInt64(name string, def int64) int64

GetInt64 は数値(int64)のプロパティ値を取得する もしdatastore上にEntityがなければ、デフォルト値を返却するのと同時に デフォルト値でEntityを作成する

func (*Property) GetString

func (p *Property) GetString(name string, def string) string

GetString は文字列のプロパティ値を取得する もしdatastore上にEntityがなければ、デフォルト値を返却するのと同時に デフォルト値でEntityを作成する

type ServerKey

type ServerKey struct {
	Name  string `datastore:"-" goon:"id"`
	Value []byte `datastore:"value,noindex"`
}

ServerKey はキーペアを保持する

Jump to

Keyboard shortcuts

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