Documentation ¶
Index ¶
- Variables
- func APIDirectorySettingsValidator(settings map[string]interface{}) (interface{}, error)
- func JSONDirectorySettingsValidator(settings map[string]interface{}) (interface{}, error)
- func MakeAPIDirectory(name string, settings interface{}) (hyper.Directory, error)
- func MakeJSONDirectory(name string, settings interface{}) (hyper.Directory, error)
- type APIDirectory
- func (f *APIDirectory) Entries(query *hyper.DirectoryQuery) ([]*hyper.DirectoryEntry, error)
- func (f *APIDirectory) EntryFor(name string) (*hyper.DirectoryEntry, error)
- func (f *APIDirectory) OwnEntry() (*hyper.DirectoryEntry, error)
- func (f *APIDirectory) Submit(signedChangeRecords []*hyper.SignedChangeRecord) error
- func (f *APIDirectory) Tip() (*hyper.SignedChangeRecord, error)
- type APIDirectorySettings
- type CacheEntry
- type DirectoryCache
- type JSONDirectory
- type JSONDirectorySettings
- type Records
- type UpdateRecords
Constants ¶
This section is empty.
Variables ¶
View Source
var APIDirectorySettingsForm = forms.Form{ Fields: []forms.Field{ { Name: "endpoints", Validators: []forms.Validator{ forms.IsStringList{}, }, }, { Name: "server_names", Validators: []forms.Validator{ forms.IsOptional{}, forms.IsStringList{}, }, }, { Name: "cache_entries_for", Validators: []forms.Validator{ forms.IsOptional{Default: 5}, forms.IsInteger{ HasMin: true, Min: 0, HasMax: true, Max: 3600, }, }, }, { Name: "jsonrpc_client", Validators: []forms.Validator{ forms.IsStringMap{ Form: &jsonrpc.JSONRPCClientSettingsForm, }, }, }, { Name: "ca_certificate_files", Validators: []forms.Validator{ forms.IsList{ Validators: []forms.Validator{ forms.IsString{}, }, }, }, }, { Name: "ca_intermediate_certificate_files", Validators: []forms.Validator{ forms.IsOptional{}, forms.IsList{ Validators: []forms.Validator{ forms.IsString{}, }, }, }, }, }, }
View Source
var Directories = hyper.DirectoryDefinitions{ "api": hyper.DirectoryDefinition{ Name: "API-Based Service Directory", Description: "Loads the service directory via a JSON-RPC API", Maker: MakeAPIDirectory, SettingsValidator: APIDirectorySettingsValidator, }, "json": hyper.DirectoryDefinition{ Name: "JSON-Based Service Directory", Description: "Loads the service directory from a JSON file", Maker: MakeJSONDirectory, SettingsValidator: JSONDirectorySettingsValidator, }, }
View Source
var JSONDirectorySettingsForm = forms.Form{ Fields: []forms.Field{ { Name: "path", Validators: []forms.Validator{ forms.IsString{}, }, }, }, }
View Source
var JSONRecordsForm = forms.Form{ Fields: []forms.Field{ { Name: "records", Validators: []forms.Validator{ forms.IsList{ Validators: []forms.Validator{ forms.IsStringMap{ Form: &hyperForms.ChangeRecordForm, }, }, }, }, }, }, }
View Source
var UpdateForm = forms.Form{ Fields: []forms.Field{ { Name: "records", Validators: []forms.Validator{ forms.IsList{ Validators: []forms.Validator{ forms.IsStringMap{ Form: &hyperForms.SignedChangeRecordForm, }, }, }, }, }, }, }
Functions ¶
func MakeAPIDirectory ¶
Types ¶
type APIDirectory ¶
type APIDirectory struct { hyper.BaseDirectory // contains filtered or unexported fields }
func (*APIDirectory) Entries ¶
func (f *APIDirectory) Entries(query *hyper.DirectoryQuery) ([]*hyper.DirectoryEntry, error)
func (*APIDirectory) EntryFor ¶
func (f *APIDirectory) EntryFor(name string) (*hyper.DirectoryEntry, error)
func (*APIDirectory) OwnEntry ¶
func (f *APIDirectory) OwnEntry() (*hyper.DirectoryEntry, error)
func (*APIDirectory) Submit ¶
func (f *APIDirectory) Submit(signedChangeRecords []*hyper.SignedChangeRecord) error
func (*APIDirectory) Tip ¶
func (f *APIDirectory) Tip() (*hyper.SignedChangeRecord, error)
type APIDirectorySettings ¶
type APIDirectorySettings struct { Endpoints []string `json:"endpoints"` ServerNames []string `json:"server_names"` JSONRPCClient *jsonrpc.JSONRPCClientSettings `json:"jsonrpc_client"` CACertificateFiles []string `json:"ca_certificate_files"` CAIntermediateCertificateFiles []string `json:"ca_intermediate_certificate_files"` CacheEntriesFor int64 `json:"cache_entries_for"` }
type CacheEntry ¶
type CacheEntry struct { Entry *hyper.DirectoryEntry FetchedAt time.Time }
type DirectoryCache ¶
type DirectoryCache struct {
Entries []*CacheEntry
}
type JSONDirectory ¶
type JSONDirectory struct { hyper.BaseDirectory // contains filtered or unexported fields }
func (*JSONDirectory) Entries ¶
func (f *JSONDirectory) Entries(query *hyper.DirectoryQuery) ([]*hyper.DirectoryEntry, error)
func (*JSONDirectory) EntryFor ¶
func (f *JSONDirectory) EntryFor(name string) (*hyper.DirectoryEntry, error)
func (*JSONDirectory) OwnEntry ¶
func (f *JSONDirectory) OwnEntry() (*hyper.DirectoryEntry, error)
type JSONDirectorySettings ¶
type JSONDirectorySettings struct {
Path string `json:"path"`
}
type Records ¶
type Records struct {
Records []*hyper.ChangeRecord `json:"records"`
}
type UpdateRecords ¶
type UpdateRecords struct {
Records []*hyper.SignedChangeRecord `json:"records"`
}
Click to show internal directories.
Click to hide internal directories.