Fix typos in miscellaneous packages
parent
52d6135daf
commit
cd64ec8718
|
@ -11,7 +11,7 @@ vendor
|
|||
# binary databases
|
||||
influxd.bolt
|
||||
|
||||
# Project distirbution
|
||||
# Project distribution
|
||||
/dist
|
||||
|
||||
# Project binaries.
|
||||
|
|
2
auth.go
2
auth.go
|
@ -38,7 +38,7 @@ func (a *Authorization) Valid() error {
|
|||
for _, p := range a.Permissions {
|
||||
if p.Resource.OrgID != nil && *p.Resource.OrgID != a.OrgID {
|
||||
return &Error{
|
||||
Msg: fmt.Sprintf("permisson %s is not for org id %s", p, a.OrgID),
|
||||
Msg: fmt.Sprintf("permission %s is not for org id %s", p, a.OrgID),
|
||||
Code: EInvalid,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ func (s *SecretService) PutSecret(ctx context.Context, orgID influxdb.ID, key st
|
|||
|
||||
// PutSecrets checks to see if the authorizer on context has read and write access to the secret keys provided.
|
||||
func (s *SecretService) PutSecrets(ctx context.Context, orgID influxdb.ID, m map[string]string) error {
|
||||
// PutSecrets operates on intersection betwen m and keys beloging to orgID.
|
||||
// PutSecrets operates on intersection between m and keys beloging to orgID.
|
||||
// We need to have read access to those secrets since it deletes the secrets (within the intersection) that have not be overridden.
|
||||
if err := authorizeReadSecret(ctx, orgID); err != nil {
|
||||
return err
|
||||
|
|
|
@ -448,7 +448,7 @@ func (m *Launcher) run(ctx context.Context) (err error) {
|
|||
// https://www.vaultproject.io/docs/commands/index.html#environment-variables
|
||||
svc, err := vault.NewSecretService()
|
||||
if err != nil {
|
||||
m.logger.Error("failed initalizing vault secret service", zap.Error(err))
|
||||
m.logger.Error("failed initializing vault secret service", zap.Error(err))
|
||||
return err
|
||||
}
|
||||
secretSvc = svc
|
||||
|
|
|
@ -52,7 +52,7 @@ type DashboardService interface {
|
|||
// AddDashboardCell adds a cell to a dashboard.
|
||||
AddDashboardCell(ctx context.Context, id ID, c *Cell, opts AddDashboardCellOptions) error
|
||||
|
||||
// RemoveDashboardCell removes a dashbaord.
|
||||
// RemoveDashboardCell removes a dashboard.
|
||||
RemoveDashboardCell(ctx context.Context, dashboardID, cellID ID) error
|
||||
|
||||
// UpdateDashboardCell replaces the dashboard cell with the provided ID.
|
||||
|
|
|
@ -84,9 +84,9 @@ func TestErrorMessage(t *testing.T) {
|
|||
want: "simple error",
|
||||
},
|
||||
{
|
||||
name: "embeded error",
|
||||
err: &platform.Error{Err: &platform.Error{Msg: "embeded error"}},
|
||||
want: "embeded error",
|
||||
name: "embedded error",
|
||||
err: &platform.Error{Err: &platform.Error{Msg: "embedded error"}},
|
||||
want: "embedded error",
|
||||
},
|
||||
{
|
||||
name: "default error",
|
||||
|
@ -120,12 +120,12 @@ func TestErrorOp(t *testing.T) {
|
|||
want: "op1",
|
||||
},
|
||||
{
|
||||
name: "embeded error",
|
||||
name: "embedded error",
|
||||
err: &platform.Error{Op: "op1", Err: &platform.Error{Code: platform.EInvalid}},
|
||||
want: "op1",
|
||||
},
|
||||
{
|
||||
name: "embeded error without op in root level",
|
||||
name: "embedded error without op in root level",
|
||||
err: &platform.Error{Err: &platform.Error{Code: platform.EInvalid, Op: "op2"}},
|
||||
want: "op2",
|
||||
},
|
||||
|
@ -160,12 +160,12 @@ func TestErrorCode(t *testing.T) {
|
|||
want: platform.ENotFound,
|
||||
},
|
||||
{
|
||||
name: "embeded error",
|
||||
name: "embedded error",
|
||||
err: &platform.Error{Code: platform.ENotFound, Err: &platform.Error{Code: platform.EInvalid}},
|
||||
want: platform.ENotFound,
|
||||
},
|
||||
{
|
||||
name: "embeded error with root level code",
|
||||
name: "embedded error with root level code",
|
||||
err: &platform.Error{Err: &platform.Error{Code: platform.EInvalid}},
|
||||
want: platform.EInvalid,
|
||||
},
|
||||
|
|
|
@ -20,7 +20,7 @@ type AuthenticationHandler struct {
|
|||
SessionService platform.SessionService
|
||||
|
||||
// This is only really used for it's lookup method the specific http
|
||||
// hanlder used to register routes does not matter.
|
||||
// handler used to register routes does not matter.
|
||||
noAuthRouter *httprouter.Router
|
||||
|
||||
Handler http.Handler
|
||||
|
|
|
@ -264,7 +264,7 @@ func (h *FluxHandler) postFluxSpec(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
// fluxParams contain flux funciton parameters as defined by the semantic graph
|
||||
// fluxParams contain flux function parameters as defined by the semantic graph
|
||||
type fluxParams map[string]string
|
||||
|
||||
// suggestionResponse provides the parameters available for a given Flux function
|
||||
|
|
|
@ -433,7 +433,7 @@ func Test_decodeQueryRequest(t *testing.T) {
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "valid query request with explict content-type",
|
||||
name: "valid query request with explicit content-type",
|
||||
args: args{
|
||||
r: func() *http.Request {
|
||||
r := httptest.NewRequest("POST", "/", bytes.NewBufferString(`{"query": "from()"}`))
|
||||
|
|
|
@ -14,7 +14,7 @@ paths:
|
|||
- $ref: '#/components/parameters/TraceSpan'
|
||||
responses:
|
||||
'204':
|
||||
description: succesfully authenticated
|
||||
description: successfully authenticated
|
||||
'401':
|
||||
description: unauthorized access
|
||||
content:
|
||||
|
@ -3007,12 +3007,12 @@ paths:
|
|||
- application/vnd.flux
|
||||
- in: query
|
||||
name: org
|
||||
description: specifies the name of the organization executing the query; if both orgID and org are specified, orgID takes precendence.
|
||||
description: specifies the name of the organization executing the query; if both orgID and org are specified, orgID takes precedence.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: orgID
|
||||
description: specifies the ID of the organization executing the query; if both orgID and org are specified, orgID takes precendence.
|
||||
description: specifies the ID of the organization executing the query; if both orgID and org are specified, orgID takes precedence.
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
|
|
|
@ -39,7 +39,7 @@ func NewMockTaskBackend(t *testing.T) *TaskBackend {
|
|||
FindOrganizationF: func(ctx context.Context, filter platform.OrganizationFilter) (*platform.Organization, error) {
|
||||
org := &platform.Organization{}
|
||||
if filter.Name != nil {
|
||||
if *filter.Name == "non-existant-org" {
|
||||
if *filter.Name == "non-existent-org" {
|
||||
return nil, &platform.Error{
|
||||
Err: errors.New("org not found or unauthorized"),
|
||||
Msg: "org " + *filter.Name + " not found or unauthorized",
|
||||
|
@ -329,7 +329,7 @@ func TestTaskHandler_handleGetTasks(t *testing.T) {
|
|||
},
|
||||
{
|
||||
name: "get tasks by org name bad",
|
||||
getParams: "org=non-existant-org",
|
||||
getParams: "org=non-existent-org",
|
||||
fields: fields{
|
||||
taskService: &mock.TaskService{
|
||||
FindTasksFn: func(ctx context.Context, f platform.TaskFilter) ([]*platform.Task, int, error) {
|
||||
|
@ -375,7 +375,7 @@ func TestTaskHandler_handleGetTasks(t *testing.T) {
|
|||
"error": {
|
||||
"code": "not found",
|
||||
"error": "org not found or unauthorized",
|
||||
"message": "org non-existant-org not found or unauthorized"
|
||||
"message": "org non-existent-org not found or unauthorized"
|
||||
},
|
||||
"message": "failed to decode request"
|
||||
}`,
|
||||
|
|
|
@ -358,7 +358,7 @@ func TestVariableService_handleGetVariable(t *testing.T) {
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "get a non-existant variable",
|
||||
name: "get a non-existent variable",
|
||||
args: args{
|
||||
id: "75650d0a636f6d70",
|
||||
},
|
||||
|
@ -695,7 +695,7 @@ func TestVariableService_handleDeleteVariable(t *testing.T) {
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "delete a non-existant variable",
|
||||
name: "delete a non-existent variable",
|
||||
fields: fields{
|
||||
&mock.VariableService{
|
||||
DeleteVariableF: func(ctx context.Context, id platform.ID) error {
|
||||
|
|
|
@ -260,7 +260,7 @@ func (s *Service) createCellView(ctx context.Context, cell *platform.Cell) *plat
|
|||
return nil
|
||||
}
|
||||
|
||||
// PutDashboardCell replaces a dashboad cell with the cell contents.
|
||||
// PutDashboardCell replaces a dashboard cell with the cell contents.
|
||||
func (s *Service) PutDashboardCell(ctx context.Context, id platform.ID, cell *platform.Cell) error {
|
||||
d, err := s.FindDashboardByID(ctx, id)
|
||||
if err != nil {
|
||||
|
|
|
@ -83,7 +83,7 @@ func (c *Check) CheckHealth(ctx context.Context) Response {
|
|||
}
|
||||
overrideResponse := Response{
|
||||
Name: "manual-override",
|
||||
Message: "health manually overriden",
|
||||
Message: "health manually overridden",
|
||||
}
|
||||
response.Checks = append(response.Checks, overrideResponse)
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ func (c *Check) CheckReady(ctx context.Context) Response {
|
|||
}
|
||||
|
||||
// SetPassthrough allows you to set a handler to use if the request is not a ready or health check.
|
||||
// This can be usefull if you intend to use this as a middleware.
|
||||
// This can be useful if you intend to use this as a middleware.
|
||||
func (c *Check) SetPassthrough(h http.Handler) {
|
||||
c.passthroughHandler = h
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ func TestForceHealth(t *testing.T) {
|
|||
Name: "Health",
|
||||
Status: "fail",
|
||||
Checks: Responses{
|
||||
Response{Name: "manual-override", Message: "health manually overriden"},
|
||||
Response{Name: "manual-override", Message: "health manually overridden"},
|
||||
Response{Name: "a", Status: "pass"},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ type Point interface {
|
|||
// the result, potentially reducing string allocations.
|
||||
AppendString(buf []byte) []byte
|
||||
|
||||
// FieldIterator retuns a FieldIterator that can be used to traverse the
|
||||
// FieldIterator returns a FieldIterator that can be used to traverse the
|
||||
// fields of a point without constructing the in-memory map.
|
||||
FieldIterator() FieldIterator
|
||||
}
|
||||
|
@ -2266,7 +2266,7 @@ func DeepCopyTags(a Tags) Tags {
|
|||
// values.
|
||||
type Fields map[string]interface{}
|
||||
|
||||
// FieldIterator retuns a FieldIterator that can be used to traverse the
|
||||
// FieldIterator returns a FieldIterator that can be used to traverse the
|
||||
// fields of a point without constructing the in-memory map.
|
||||
func (p *point) FieldIterator() FieldIterator {
|
||||
p.Reset()
|
||||
|
@ -2387,7 +2387,7 @@ func (p *point) Reset() {
|
|||
}
|
||||
|
||||
// MarshalBinary encodes all the fields to their proper type and returns the binary
|
||||
// represenation
|
||||
// representation
|
||||
// NOTE: uint64 is specifically not supported due to potential overflow when we decode
|
||||
// again later to an int64
|
||||
// NOTE2: uint is accepted, and may be 64 bits, and is for some reason accepted...
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// MinNanoTime is the minumum time that can be represented.
|
||||
// MinNanoTime is the minimum time that can be represented.
|
||||
//
|
||||
// 1677-09-21 00:12:43.145224194 +0000 UTC
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Package simple8b implements the 64bit integer encoding algoritm as published
|
||||
// Package simple8b implements the 64bit integer encoding algorithm as published
|
||||
// by Ann and Moffat in "Index compression using 64-bit words", Softw. Pract. Exper. 2010; 40:131–147
|
||||
//
|
||||
// It is capable of encoding multiple integers with values betweeen 0 and to 1^60 -1, in a single word.
|
||||
|
@ -21,7 +21,7 @@ package simple8b
|
|||
// └──────────────┴─────────────────────────────────────────────────────────────┘
|
||||
//
|
||||
// For example, when the number of values can be encoded using 4 bits, selected 5 is encoded in the
|
||||
// 4 most significant bits followed by 15 values encoded used 4 bits each in the remaing 60 bits.
|
||||
// 4 most significant bits followed by 15 values encoded used 4 bits each in the remaining 60 bits.
|
||||
import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
|
|
|
@ -64,7 +64,7 @@ type Plus struct {
|
|||
tmpSet set
|
||||
|
||||
denseList []uint8 // The dense representation of the HLL.
|
||||
sparseList *compressedList // values that can be stored in the sparse represenation.
|
||||
sparseList *compressedList // values that can be stored in the sparse representation.
|
||||
}
|
||||
|
||||
// NewPlus returns a new Plus with precision p. p must be between 4 and 18.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Package pointer provides utilities for pointer handling that aren't avaliable in go.
|
||||
// Package pointer provides utilities for pointer handling that aren't available in go.
|
||||
// Feel free to add more pointerification functions for more types as you need them.
|
||||
package pointer
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ type Encoder interface {
|
|||
Encode(mfs []*dto.MetricFamily) ([]byte, error)
|
||||
}
|
||||
|
||||
// Expfmt is encodes metric familes into promtheus exposition format.
|
||||
// Expfmt encodes metric families into prometheus exposition format.
|
||||
type Expfmt struct {
|
||||
Format expfmt.Format
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ func EncodeExpfmt(mfs []*dto.MetricFamily, opts ...expfmt.Format) ([]byte, error
|
|||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
// JSON is encodes metric familes into JSON.
|
||||
// JSON encodes metric families into JSON.
|
||||
type JSON struct{}
|
||||
|
||||
// Encode encodes metrics JSON bytes. This not always works
|
||||
|
@ -100,7 +100,7 @@ const (
|
|||
nsPerMilliseconds = int64(time.Millisecond / time.Nanosecond)
|
||||
)
|
||||
|
||||
// LineProtocol is encodes metric familes into influxdb lineprotocl.
|
||||
// LineProtocol encodes metric families into influxdb line protocol.
|
||||
type LineProtocol struct{}
|
||||
|
||||
// Encode encodes metrics into line protocol format bytes.
|
||||
|
|
|
@ -24,7 +24,7 @@ type IteratorOptions struct {
|
|||
// This can be VarRef or a Call.
|
||||
Expr influxql.Expr
|
||||
|
||||
// Auxilary tags or values to also retrieve for the point.
|
||||
// Auxiliary tags or values to also retrieve for the point.
|
||||
Aux []influxql.VarRef
|
||||
|
||||
// Data sources from which to receive data. This is only used for encoding
|
||||
|
@ -489,12 +489,12 @@ var OpenAuthorizer = openAuthorizer{}
|
|||
// AuthorizeDatabase returns true to allow any operation on a database.
|
||||
func (a openAuthorizer) AuthorizeDatabase(influxql.Privilege, string) bool { return true }
|
||||
|
||||
// AuthorizeSeriesRead allows accesss to any series.
|
||||
// AuthorizeSeriesRead allows access to any series.
|
||||
func (a openAuthorizer) AuthorizeSeriesRead(database string, measurement []byte, tags models.Tags) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// AuthorizeSeriesWrite allows accesss to any series.
|
||||
// AuthorizeSeriesWrite allows access to any series.
|
||||
func (a openAuthorizer) AuthorizeSeriesWrite(database string, measurement []byte, tags models.Tags) bool {
|
||||
return true
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ func NewWAL(path string) *WAL {
|
|||
path: path,
|
||||
enabled: true,
|
||||
|
||||
// these options should be overriden by any options in the config
|
||||
// these options should be overridden by any options in the config
|
||||
SegmentSize: DefaultSegmentSize,
|
||||
closing: make(chan struct{}),
|
||||
syncWaiters: make(chan chan error, 1024),
|
||||
|
|
|
@ -657,7 +657,7 @@ func (s *Store) Close() error {
|
|||
return s.db.Close()
|
||||
}
|
||||
|
||||
// DeleteOrg syncronously deletes an org and all their tasks from a bolt store.
|
||||
// DeleteOrg synchronously deletes an org and all their tasks from a bolt store.
|
||||
func (s *Store) DeleteOrg(ctx context.Context, id platform.ID) error {
|
||||
orgID, err := id.Encode()
|
||||
if err != nil {
|
||||
|
|
|
@ -105,7 +105,7 @@ func (qlr *QueryLogReader) ListRuns(ctx context.Context, orgID platform.ID, runF
|
|||
|
||||
// Because flux doesnt support piviting on a rowkey that might not exist we need first check if we can pivot with "requestedAt"
|
||||
// and if that fails we can fall back to pivot without "requestedAt"
|
||||
// TODO(lh): After we transition to a seperation of transactional and analytical stores this can be simplified.
|
||||
// TODO(lh): After we transition to a separation of transactional and analytical stores this can be simplified.
|
||||
pivotWithRequestedAt := `|> pivot(rowKey:["runID", "scheduledFor", "requestedAt"], columnKey: ["status"], valueColumn: "_time")`
|
||||
pivotWithOutRequestedAt := `|> pivot(rowKey:["runID", "scheduledFor"], columnKey: ["status"], valueColumn: "_time")`
|
||||
|
||||
|
|
|
@ -281,7 +281,7 @@ func (d *TaskControlService) AddRunLog(ctx context.Context, taskID, runID influx
|
|||
|
||||
run := d.runs[taskID][runID]
|
||||
if run == nil {
|
||||
panic("cannot add a log to a non existant run")
|
||||
panic("cannot add a log to a non existent run")
|
||||
}
|
||||
run.Log = append(run.Log, influxdb.Log{Time: when.Format(time.RFC3339Nano), Message: log})
|
||||
return nil
|
||||
|
|
|
@ -122,7 +122,7 @@ type TestCreds struct {
|
|||
Token string
|
||||
}
|
||||
|
||||
// Authorizer returns an authorizer for the credentails in the struct
|
||||
// Authorizer returns an authorizer for the credentials in the struct
|
||||
func (tc TestCreds) Authorizer() influxdb.Authorizer {
|
||||
return &influxdb.Authorization{
|
||||
ID: tc.AuthorizationID,
|
||||
|
|
|
@ -573,7 +573,7 @@ func DeleteLabel(
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "deleting a non-existant label",
|
||||
name: "deleting a non-existent label",
|
||||
fields: LabelFields{
|
||||
Labels: []*influxdb.Label{
|
||||
{
|
||||
|
|
|
@ -183,7 +183,7 @@ func FindSession(
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "look for not exising session",
|
||||
name: "look for not existing session",
|
||||
args: args{
|
||||
key: "abc123xyz",
|
||||
},
|
||||
|
|
|
@ -216,7 +216,7 @@ func DeleteUserResourceMapping(
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "deleting a non-existant user",
|
||||
name: "deleting a non-existent user",
|
||||
fields: UserResourceFields{
|
||||
UserResourceMappings: []*platform.UserResourceMapping{},
|
||||
},
|
||||
|
|
|
@ -275,7 +275,7 @@ func FindVariableByID(init func(VariableFields, *testing.T) (platform.VariableSe
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "finding a non-existant variable",
|
||||
name: "finding a non-existent variable",
|
||||
fields: VariableFields{
|
||||
Variables: []*platform.Variable{},
|
||||
},
|
||||
|
@ -538,7 +538,7 @@ func UpdateVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "updating a non-existant variable fails",
|
||||
name: "updating a non-existent variable fails",
|
||||
fields: VariableFields{
|
||||
Variables: []*platform.Variable{},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue