Documentation
¶
Index ¶
- type FileWatcher
- type FileWatcherOpt
- type Keys
- func (k *Keys) APIKey() string
- func (k *Keys) HasWatcher() bool
- func (k *Keys) ProsopoIntegrityToken() string
- func (k *Keys) ProsopoSiteKey() string
- func (k *Keys) SetWatcher(watcher Watcher)
- func (k *Keys) StartWatching() error
- func (k *Keys) StopWatching()
- func (k *Keys) Update(apiKey, userAgent, prosopoSiteKey, prosopoIntegrityToken *string)
- func (k *Keys) UpdateFromJSON(keysJson []byte) error
- func (k *Keys) UserAgent() string
- type URLWatcher
- type URLWatcherOpt
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileWatcher ¶
type FileWatcher struct {
// contains filtered or unexported fields
}
FileWatcher watches a file for key updates.
func NewFileWatcher ¶
func NewFileWatcher(path string, opts ...FileWatcherOpt) *FileWatcher
func (*FileWatcher) StartWatching ¶
func (w *FileWatcher) StartWatching(keys *Keys) error
func (*FileWatcher) StopWatching ¶
func (w *FileWatcher) StopWatching()
type FileWatcherOpt ¶
type FileWatcherOpt func(*FileWatcher)
func WithFileWatcherCtx ¶
func WithFileWatcherCtx(ctx context.Context) FileWatcherOpt
type Keys ¶
type Keys struct {
// contains filtered or unexported fields
}
func LoadKeysFromFile ¶
func LoadKeysFromFile(path string, watcherOpts ...FileWatcherOpt) (*Keys, error)
func LoadKeysFromURL ¶
func LoadKeysFromURL(url string, watcherOpts ...URLWatcherOpt) (*Keys, error)
func (*Keys) HasWatcher ¶
func (*Keys) ProsopoIntegrityToken ¶
func (*Keys) ProsopoSiteKey ¶
func (*Keys) SetWatcher ¶
func (*Keys) StartWatching ¶
func (*Keys) StopWatching ¶
func (k *Keys) StopWatching()
func (*Keys) UpdateFromJSON ¶
type URLWatcher ¶
type URLWatcher struct {
// contains filtered or unexported fields
}
URLWatcher watches a URL for key updates by polling at a regular interval.
func NewURLWatcher ¶
func NewURLWatcher(url string, opts ...URLWatcherOpt) *URLWatcher
func (*URLWatcher) StartWatching ¶
func (w *URLWatcher) StartWatching(keys *Keys) error
func (*URLWatcher) StopWatching ¶
func (w *URLWatcher) StopWatching()
type URLWatcherOpt ¶
type URLWatcherOpt func(*URLWatcher)
func WithURLWatcherCtx ¶
func WithURLWatcherCtx(ctx context.Context) URLWatcherOpt
func WithURLWatcherHTTPClient ¶
func WithURLWatcherHTTPClient(client *http.Client) URLWatcherOpt
func WithURLWatcherPollInterval ¶
func WithURLWatcherPollInterval(d time.Duration) URLWatcherOpt
Click to show internal directories.
Click to hide internal directories.