Documentation ¶
Overview ¶
http://openmymind.net/Shard-Your-Hash-table-to-reduce-write-locks/
Copyright (c) 2015 Stuart Glenn All rights reserved Use of this source code is goverened by a BSD 3-clause license, see included LICENSE file for details Datastore for perstiance of access rules, clients & keys
ATM - Automatic TempUrl Maker Copyright (c) 2015 Stuart Glenn All rights reserved Use of this source code is goverened by a BSD 3-clause license, see included LICENSE file for details Contains the main logic behind making TempUrls
Index ¶
- Constants
- func ErrMsg(msg string) map[string]string
- func HMACAuth(o *HmacOpts) echo.HandlerFunc
- type Account
- type AtmClient
- type Authorizor
- type Cache
- type Datastore
- func (d *Datastore) Account(name string) (*Account, error)
- func (d *Datastore) AddSigningKeyForAccount(key, account string)
- func (d *Datastore) ApiKeySecret(apiKey string) (string, error)
- func (d *Datastore) Close() error
- func (d *Datastore) KeyForRequest(u *UrlRequest, appId string) (string, int64, error)
- func (d *Datastore) Ping() error
- func (d *Datastore) RemoveSigningKeyForAccount(account string)
- type ExpiringCache
- type HmacOpts
- type KeyFinder
- type NonceChecker
- type NonceStore
- type Server
- type Tmpurl
- type UrlRequest
Constants ¶
View Source
const ( HOST = "https://o3.omrf.org" DURATION = 5 * time.Minute )
View Source
const API_KEY = "api-key"
View Source
const AUTH_SEP = ":"
View Source
const CONTENT_MD5 = "Content-MD5"
View Source
const CONTENT_TYPE = "Content-Type"
View Source
const XNONCE = "X-Nonce"
View Source
const XTIME = "X-Timestamp"
Variables ¶
This section is empty.
Functions ¶
func HMACAuth ¶
func HMACAuth(o *HmacOpts) echo.HandlerFunc
Types ¶
type Authorizor ¶
type Authorizor struct { ApiKey string Signature string Md5 string Type string Nonce string Xtime string Method string Uri string Timestamp time.Time Opts *HmacOpts }
func AuthorizorForRequest ¶
func AuthorizorForRequest(o *HmacOpts, method string, uri string) *Authorizor
func (*Authorizor) SignatureWith ¶
func (a *Authorizor) SignatureWith(key string) string
func (*Authorizor) SigningString ¶
func (a *Authorizor) SigningString() string
Build the content for signging & sign it with the key method\nURI\nMD5\ntype\ntimestamp\nnonce
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
func NewDatastore ¶
func (*Datastore) AddSigningKeyForAccount ¶
func (*Datastore) KeyForRequest ¶
func (*Datastore) RemoveSigningKeyForAccount ¶
type ExpiringCache ¶
type ExpiringCache struct {
// contains filtered or unexported fields
}
func NewExpiringCache ¶
func NewExpiringCache(scrubInterval time.Duration) *ExpiringCache
func (ExpiringCache) DeleteExpired ¶
func (c ExpiringCache) DeleteExpired()
func (*ExpiringCache) Get ¶
func (c *ExpiringCache) Get(k string) (interface{}, bool)
type HmacOpts ¶
type HmacOpts struct { AuthPrefix string Expiration time.Duration SecretKeyFor KeyFinder NonceChecker NonceChecker }
func NewHmacOpts ¶
func NewHmacOpts(f KeyFinder, nc NonceChecker) *HmacOpts
type NonceChecker ¶
type NonceStore ¶
type NonceStore struct {
// contains filtered or unexported fields
}
func NewNonceStore ¶
func NewNonceStore() NonceStore
func (NonceStore) Add ¶
func (d NonceStore) Add(n string)
func (NonceStore) Valid ¶
func (d NonceStore) Valid(n string) bool
type Server ¶
type Server struct { Ds *Datastore Object_host string Default_duration int64 Nonces NonceChecker }
type UrlRequest ¶
type UrlRequest struct { Account string `json:account` Container string `json:container` Object string `json:object` Method string `json:method` Key string `json:"-"` Host string `json:"-"` Duration int64 `json:"-"` }
func (*UrlRequest) Path ¶
func (u *UrlRequest) Path() string
func (*UrlRequest) SignedUrl ¶
func (u *UrlRequest) SignedUrl() string
func (*UrlRequest) Valid ¶
func (u *UrlRequest) Valid() bool
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
ATM - Automatic TempUrl Maker A builder of Swift TempURLs Copyright (c) 2015 Stuart Glenn All rights reserved Use of this source code is goverened by a BSD 3-clause license, see included LICENSE file for details
|
ATM - Automatic TempUrl Maker A builder of Swift TempURLs Copyright (c) 2015 Stuart Glenn All rights reserved Use of this source code is goverened by a BSD 3-clause license, see included LICENSE file for details |
Click to show internal directories.
Click to hide internal directories.