fixed spelling errors
This commit is contained in:
parent
5bb0d0aaf2
commit
9064364325
@ -31,7 +31,7 @@ type Neighbor struct {
|
||||
}
|
||||
|
||||
// String encodes a neighbor as json. This is
|
||||
// more readable than the golang default represenation.
|
||||
// more readable than the golang default representation.
|
||||
func (n *Neighbor) String() string {
|
||||
repr, _ := json.Marshal(n)
|
||||
return string(repr)
|
||||
|
@ -102,7 +102,7 @@ type RoutesResponse struct {
|
||||
NotExported Routes `json:"not_exported"`
|
||||
}
|
||||
|
||||
// CacheTTL returns the cache ttl of the reponse
|
||||
// CacheTTL returns the cache ttl of the response
|
||||
func (res *RoutesResponse) CacheTTL() time.Duration {
|
||||
now := time.Now().UTC()
|
||||
return res.Response.Meta.TTL.Sub(now)
|
||||
@ -113,7 +113,7 @@ type TimedResponse struct {
|
||||
RequestDuration float64 `json:"request_duration_ms"`
|
||||
}
|
||||
|
||||
// Pagination strucutres information about the
|
||||
// Pagination information, including the
|
||||
// current page, total pages, page size, etc...
|
||||
type Pagination struct {
|
||||
Page int `json:"page"`
|
||||
|
@ -177,7 +177,7 @@ func (g *SearchFilterGroup) rebuildIndex() {
|
||||
g.filtersIdx = idx // replace index
|
||||
}
|
||||
|
||||
// A SearchFilterComparator comapres route with a filter
|
||||
// A SearchFilterComparator compares route with a filter
|
||||
type SearchFilterComparator func(route Filterable, value interface{}) bool
|
||||
|
||||
func searchFilterMatchSource(route Filterable, value interface{}) bool {
|
||||
@ -351,7 +351,7 @@ func (s *SearchFilters) GetGroupByKey(key string) *SearchFilterGroup {
|
||||
// and its counters.
|
||||
//
|
||||
// Update filter struct to include route:
|
||||
// - Extract ASN, source, bgp communites,
|
||||
// - Extract ASN, source, bgp communities,
|
||||
// - Find Filter in group, increment result count if required.
|
||||
func (s *SearchFilters) UpdateFromLookupRoute(r *LookupRoute) {
|
||||
// Add source
|
||||
|
@ -36,7 +36,7 @@ func StringList(data interface{}) []string {
|
||||
}
|
||||
|
||||
// TrimmedCSVStringList makes a trimmed list of CSV strings
|
||||
// ommitting empty values.
|
||||
// omitting empty values.
|
||||
func TrimmedCSVStringList(s string) []string {
|
||||
tokens := strings.Split(s, ",")
|
||||
list := []string{}
|
||||
|
@ -39,7 +39,7 @@ type apiEndpoint func(
|
||||
httprouter.Params,
|
||||
) (response, error)
|
||||
|
||||
// Wrap handler for access controll, throtteling and compression
|
||||
// Wrap handler for access control, throtteling and compression
|
||||
func endpoint(wrapped apiEndpoint) httprouter.Handle {
|
||||
return func(res http.ResponseWriter,
|
||||
req *http.Request,
|
||||
|
@ -38,7 +38,7 @@ func NewErrAmbigousParam(key string) *ErrValidationFailed {
|
||||
}
|
||||
|
||||
// NewErrEmptyParam return an ErrValidationFailed if the
|
||||
// provided paramter value is empty.
|
||||
// provided parameter value is empty.
|
||||
func NewErrEmptyParam(key string) *ErrValidationFailed {
|
||||
return &ErrValidationFailed{
|
||||
Param: key,
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func TestApiLogSourceError(t *testing.T) {
|
||||
err := fmt.Errorf("an unexpected error occured")
|
||||
err := fmt.Errorf("an unexpected error occurred")
|
||||
|
||||
cfg := &config.Config{
|
||||
Sources: []*config.SourceConfig{
|
||||
|
@ -153,9 +153,6 @@ func (b *GenericBirdwatcher) filterRoutesByDuplicates(
|
||||
// Remove routes from "routes" that are contained within filterRoutes
|
||||
for _, filterRoute := range filterRoutes {
|
||||
delete(routesMap, filterRoute.ID)
|
||||
// in theorey this guard is unneccessary
|
||||
//if _, ok := routesMap[filterRoute.ID]; ok {
|
||||
// }
|
||||
}
|
||||
|
||||
for _, route := range routesMap {
|
||||
|
@ -160,9 +160,9 @@ func TestLookupPrefixForNeighbors(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// We should have retrived 8 prefixes,
|
||||
// We should have retrieved 8 prefixes,
|
||||
if len(results) != 8 {
|
||||
t.Error("Expected result lenght: 8, got:", len(results))
|
||||
t.Error("Expected result length: 8, got:", len(results))
|
||||
}
|
||||
|
||||
presence := []string{
|
||||
|
@ -141,7 +141,7 @@ func (s *SourcesStore) getStatus(sourceID string) (*Status, error) {
|
||||
}
|
||||
|
||||
// IsInitialized will retrieve the status of the source
|
||||
// and check if a successful refresh happend at least
|
||||
// and check if a successful refresh happened at least
|
||||
// once.
|
||||
func (s *SourcesStore) IsInitialized(sourceID string) (bool, error) {
|
||||
s.Lock()
|
||||
@ -190,7 +190,7 @@ func (s *SourcesStore) ShouldRefresh(
|
||||
}
|
||||
if status.State == StateError {
|
||||
// The refresh interval in the config is ok if the
|
||||
// success case. When an error occures it is desireable
|
||||
// success case. When an error occures it is desirable
|
||||
// to retry sooner, without spamming the server.
|
||||
nextRefresh = status.LastRefresh.Add(10 * time.Second)
|
||||
}
|
||||
@ -303,7 +303,7 @@ func (s *SourcesStore) LockSource(sourceID string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// RefreshSuccess indicates a successfull update
|
||||
// RefreshSuccess indicates a successful update
|
||||
// of the store's content.
|
||||
func (s *SourcesStore) RefreshSuccess(sourceID string) error {
|
||||
s.Lock()
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
|
||||
func TestContainsCi(t *testing.T) {
|
||||
if ContainsCi("foo bar", "BaR") != true {
|
||||
t.Error("An unexpected error occured.")
|
||||
t.Error("An unexpected error occurred.")
|
||||
}
|
||||
if ContainsCi("Luxembourg Online SA", "Goo") == true {
|
||||
t.Error("Should ne no match")
|
||||
|
Loading…
x
Reference in New Issue
Block a user