Documentation
¶
Index ¶
- Constants
- Variables
- func CompareSuppliers(a, b SupplierOrdering) int
- func GetBrokerMode(vendor dirapi.EntryVendor) common.BrokerMode
- func GetVendorFromUrl(url string) dirapi.EntryVendor
- type ApiDirectory
- type DirectoryEntry
- type DirectoryLookupAdapter
- type DirectoryLookupParams
- type MockDirectoryLookupAdapter
- type Network
- type NetworkMatch
- type Request
- type Requester
- type RotaInfo
- type Supplier
- type SupplierMatch
- func (s SupplierMatch) GetCost() float64
- func (s SupplierMatch) GetLocationPreference() int
- func (s SupplierMatch) GetPriority() int
- func (s SupplierMatch) GetRatio() float32
- func (s SupplierMatch) GetShelvingPreference() int
- func (s SupplierMatch) GetSymbol() string
- func (s SupplierMatch) IsLocal() bool
- type SupplierOrdering
- type Tier
- type TierMatch
Constants ¶
View Source
const ( DirectoryAdapter string = "DIRECTORY_ADAPTER" DirectoryApiUrl string = "DIRECTORY_API_URL" )
View Source
const COMP = "api_directory"
Variables ¶
View Source
var DEFAULT_BROKER_MODE common.BrokerMode
View Source
var MOCK_PEER_URL = common.GetEnvWithDeprecated("MOCK_PEER_URL", "MOCK_CLIENT_URL", "http://localhost:19083/iso18626")
Functions ¶
func CompareSuppliers ¶
func CompareSuppliers(a, b SupplierOrdering) int
func GetBrokerMode ¶
func GetBrokerMode(vendor dirapi.EntryVendor) common.BrokerMode
func GetVendorFromUrl ¶
func GetVendorFromUrl(url string) dirapi.EntryVendor
Types ¶
type ApiDirectory ¶
type ApiDirectory struct {
// contains filtered or unexported fields
}
func (*ApiDirectory) FilterAndSort ¶
func (a *ApiDirectory) FilterAndSort(ctx common.ExtendedContext, entries []Supplier, requesterData dirapi.Entry, serviceInfo *iso18626.ServiceInfo, billingInfo *iso18626.BillingInfo) ([]Supplier, RotaInfo)
func (*ApiDirectory) Lookup ¶
func (a *ApiDirectory) Lookup(ctx common.ExtendedContext, params DirectoryLookupParams) ([]DirectoryEntry, string, error)
type DirectoryEntry ¶
type DirectoryEntry struct {
Symbols []string
BranchSymbols []string
Name string
URL string
Vendor dirapi.EntryVendor
BrokerMode common.BrokerMode
CustomData dirapi.Entry
}
type DirectoryLookupAdapter ¶
type DirectoryLookupAdapter interface {
Lookup(ctx common.ExtendedContext, params DirectoryLookupParams) ([]DirectoryEntry, string, error)
FilterAndSort(ctx common.ExtendedContext, entries []Supplier, requesterData dirapi.Entry, serviceInfo *iso18626.ServiceInfo, billingInfo *iso18626.BillingInfo) ([]Supplier, RotaInfo)
}
func CreateApiDirectory ¶
func CreateApiDirectory(client *http.Client, urls []string) DirectoryLookupAdapter
func CreateDirectoryLookupAdapter ¶
func CreateDirectoryLookupAdapter(cfg map[string]string) (DirectoryLookupAdapter, error)
type DirectoryLookupParams ¶
type MockDirectoryLookupAdapter ¶
type MockDirectoryLookupAdapter struct {
}
func (*MockDirectoryLookupAdapter) FilterAndSort ¶
func (m *MockDirectoryLookupAdapter) FilterAndSort(ctx common.ExtendedContext, entries []Supplier, requesterData dirapi.Entry, serviceInfo *iso18626.ServiceInfo, billingInfo *iso18626.BillingInfo) ([]Supplier, RotaInfo)
func (*MockDirectoryLookupAdapter) Lookup ¶
func (m *MockDirectoryLookupAdapter) Lookup(ctx common.ExtendedContext, params DirectoryLookupParams) ([]DirectoryEntry, string, error)
type NetworkMatch ¶
type RotaInfo ¶
type RotaInfo struct {
Request Request `json:"request"`
Requester Requester `json:"requester"`
Suppliers []SupplierMatch `json:"suppliers"`
}
type Supplier ¶
type Supplier struct {
LocalIdentifier string
PeerId string
CustomData dirapi.Entry
Symbol string
Priority int
Cost float64
Local bool
Ratio float32
SupplierStatus pgtype.Text
Location string
ShelvingLocation string
ItemLoanPolicy string
LocationPreference int
ShelvingPreference int
}
func (Supplier) GetLocationPreference ¶
func (Supplier) GetPriority ¶
func (Supplier) GetShelvingPreference ¶
type SupplierMatch ¶
type SupplierMatch struct {
Match bool `json:"match"`
Networks []NetworkMatch `json:"networks"`
Tiers []TierMatch `json:"tiers"`
Symbol string `json:"symbol"`
Priority int `json:"priority"`
Cost string `json:"cost"`
Local bool `json:"local"`
Ratio float32 `json:"ratio"`
Location string `json:"location,omitempty"`
ShelvingLocation string `json:"shelvingLocation,omitempty"`
ItemLoanPolicy string `json:"itemLoanPolicy,omitempty"`
LocationPreference int `json:"locationPreference"`
ShelvingPreference int `json:"shelvingPreference"`
}
func (SupplierMatch) GetCost ¶
func (s SupplierMatch) GetCost() float64
func (SupplierMatch) GetLocationPreference ¶
func (s SupplierMatch) GetLocationPreference() int
func (SupplierMatch) GetPriority ¶
func (s SupplierMatch) GetPriority() int
func (SupplierMatch) GetRatio ¶
func (s SupplierMatch) GetRatio() float32
func (SupplierMatch) GetShelvingPreference ¶
func (s SupplierMatch) GetShelvingPreference() int
func (SupplierMatch) GetSymbol ¶
func (s SupplierMatch) GetSymbol() string
func (SupplierMatch) IsLocal ¶
func (s SupplierMatch) IsLocal() bool
type SupplierOrdering ¶
Click to show internal directories.
Click to hide internal directories.