Documentation ¶
Overview ¶
Copyright 2018 Northern.tech AS
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 Northern.tech AS
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 Northern.tech AS
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 Northern.tech AS
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 Northern.tech AS
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- type DataStoreMongo
- func (db *DataStoreMongo) AddAuthSet(ctx context.Context, set model.AuthSet) error
- func (db *DataStoreMongo) AddDevice(ctx context.Context, d model.Device) error
- func (db *DataStoreMongo) AddToken(ctx context.Context, t model.Token) error
- func (db *DataStoreMongo) DeleteAuthSetForDevice(ctx context.Context, devId string, authId string) error
- func (db *DataStoreMongo) DeleteAuthSetsForDevice(ctx context.Context, devid string) error
- func (db *DataStoreMongo) DeleteBrokenAuthSets(dbName string) error
- func (db *DataStoreMongo) DeleteBrokenTokens(dbName string) error
- func (db *DataStoreMongo) DeleteDevice(ctx context.Context, id string) error
- func (db *DataStoreMongo) DeleteDevicesBeingDecommissioned(dbName string) error
- func (db *DataStoreMongo) DeleteToken(ctx context.Context, jti string) error
- func (db *DataStoreMongo) DeleteTokenByDevId(ctx context.Context, devId string) error
- func (db *DataStoreMongo) DeleteTokens(ctx context.Context) error
- func (db *DataStoreMongo) EnsureIndexes(ctx context.Context, s *mgo.Session) error
- func (db *DataStoreMongo) GetAuthSetById(ctx context.Context, auth_id string) (*model.AuthSet, error)
- func (db *DataStoreMongo) GetAuthSetByIdDataHashKey(ctx context.Context, idDataHash []byte, key string) (*model.AuthSet, error)
- func (db *DataStoreMongo) GetAuthSets(ctx context.Context, skip, limit int, filter store.AuthSetFilter) ([]model.DevAdmAuthSet, error)
- func (db *DataStoreMongo) GetAuthSetsForDevice(ctx context.Context, devid string) ([]model.AuthSet, error)
- func (db *DataStoreMongo) GetBrokenAuthSets(dbName string) ([]string, error)
- func (db *DataStoreMongo) GetBrokenTokens(dbName string) ([]string, error)
- func (db *DataStoreMongo) GetDevCountByStatus(ctx context.Context, status string) (int, error)
- func (db *DataStoreMongo) GetDeviceById(ctx context.Context, id string) (*model.Device, error)
- func (db *DataStoreMongo) GetDeviceByIdentityDataHash(ctx context.Context, idataHash []byte) (*model.Device, error)
- func (db *DataStoreMongo) GetDeviceStatus(ctx context.Context, devId string) (string, error)
- func (db *DataStoreMongo) GetDevices(ctx context.Context, skip, limit uint, filter store.DeviceFilter) ([]model.Device, error)
- func (db *DataStoreMongo) GetDevicesBeingDecommissioned(dbName string) ([]model.Device, error)
- func (db *DataStoreMongo) GetLimit(ctx context.Context, name string) (*model.Limit, error)
- func (db *DataStoreMongo) GetTenantDbs() ([]string, error)
- func (db *DataStoreMongo) GetToken(ctx context.Context, jti string) (*model.Token, error)
- func (db *DataStoreMongo) Migrate(ctx context.Context, version string) error
- func (db *DataStoreMongo) MigrateTenant(ctx context.Context, database, version string) error
- func (db *DataStoreMongo) PutLimit(ctx context.Context, lim model.Limit) error
- func (db *DataStoreMongo) UpdateAuthSet(ctx context.Context, filter interface{}, mod model.AuthSetUpdate) error
- func (db *DataStoreMongo) UpdateDevice(ctx context.Context, d model.Device, updev model.DeviceUpdate) error
- func (db *DataStoreMongo) WithAutomigrate() store.DataStore
- func (db *DataStoreMongo) WithMultitenant() *DataStoreMongo
- type DataStoreMongoConfig
Constants ¶
const ( DbVersion = "1.5.0" DbName = "deviceauth" DbDevicesColl = "devices" DbAuthSetColl = "auth_sets" DbTokensColl = "tokens" DbLimitsColl = "limits" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataStoreMongo ¶
type DataStoreMongo struct {
// contains filtered or unexported fields
}
func NewDataStoreMongo ¶
func NewDataStoreMongo(config DataStoreMongoConfig) (*DataStoreMongo, error)
func NewDataStoreMongoWithSession ¶
func NewDataStoreMongoWithSession(session *mgo.Session) *DataStoreMongo
func (*DataStoreMongo) AddAuthSet ¶
func (*DataStoreMongo) DeleteAuthSetForDevice ¶
func (*DataStoreMongo) DeleteAuthSetsForDevice ¶
func (db *DataStoreMongo) DeleteAuthSetsForDevice(ctx context.Context, devid string) error
func (*DataStoreMongo) DeleteBrokenAuthSets ¶
func (db *DataStoreMongo) DeleteBrokenAuthSets(dbName string) error
Deletes auth sets owned by devices that are in decommissioning state and auth sets not owned by any device.
func (*DataStoreMongo) DeleteBrokenTokens ¶
func (db *DataStoreMongo) DeleteBrokenTokens(dbName string) error
Deletes tokens owned by devices that are in decommissioning state and tokens not owned by any device.
func (*DataStoreMongo) DeleteDevice ¶
func (db *DataStoreMongo) DeleteDevice(ctx context.Context, id string) error
func (*DataStoreMongo) DeleteDevicesBeingDecommissioned ¶
func (db *DataStoreMongo) DeleteDevicesBeingDecommissioned(dbName string) error
Deletes devices with decommissioning flag set
func (*DataStoreMongo) DeleteToken ¶
func (db *DataStoreMongo) DeleteToken(ctx context.Context, jti string) error
func (*DataStoreMongo) DeleteTokenByDevId ¶
func (db *DataStoreMongo) DeleteTokenByDevId(ctx context.Context, devId string) error
func (*DataStoreMongo) DeleteTokens ¶
func (db *DataStoreMongo) DeleteTokens(ctx context.Context) error
func (*DataStoreMongo) EnsureIndexes ¶
func (*DataStoreMongo) GetAuthSetById ¶
func (*DataStoreMongo) GetAuthSetByIdDataHashKey ¶
func (*DataStoreMongo) GetAuthSets ¶
func (db *DataStoreMongo) GetAuthSets(ctx context.Context, skip, limit int, filter store.AuthSetFilter) ([]model.DevAdmAuthSet, error)
func (*DataStoreMongo) GetAuthSetsForDevice ¶
func (*DataStoreMongo) GetBrokenAuthSets ¶
func (db *DataStoreMongo) GetBrokenAuthSets(dbName string) ([]string, error)
Retrieves Ids of the auth sets owned by devices that are in decommissioning state or not owned by any device.
func (*DataStoreMongo) GetBrokenTokens ¶
func (db *DataStoreMongo) GetBrokenTokens(dbName string) ([]string, error)
Get Ids of the tokens owned by devices that are in decommissioning state and tokens not owned by any device.
func (*DataStoreMongo) GetDevCountByStatus ¶
func (*DataStoreMongo) GetDeviceById ¶
func (*DataStoreMongo) GetDeviceByIdentityDataHash ¶
func (*DataStoreMongo) GetDeviceStatus ¶
func (*DataStoreMongo) GetDevices ¶
func (db *DataStoreMongo) GetDevices(ctx context.Context, skip, limit uint, filter store.DeviceFilter) ([]model.Device, error)
func (*DataStoreMongo) GetDevicesBeingDecommissioned ¶
func (db *DataStoreMongo) GetDevicesBeingDecommissioned(dbName string) ([]model.Device, error)
Retrieves devices with decommissioning flag set
func (*DataStoreMongo) GetTenantDbs ¶
func (db *DataStoreMongo) GetTenantDbs() ([]string, error)
func (*DataStoreMongo) Migrate ¶
func (db *DataStoreMongo) Migrate(ctx context.Context, version string) error
func (*DataStoreMongo) MigrateTenant ¶
func (db *DataStoreMongo) MigrateTenant(ctx context.Context, database, version string) error
func (*DataStoreMongo) UpdateAuthSet ¶
func (db *DataStoreMongo) UpdateAuthSet(ctx context.Context, filter interface{}, mod model.AuthSetUpdate) error
func (*DataStoreMongo) UpdateDevice ¶
func (db *DataStoreMongo) UpdateDevice(ctx context.Context, d model.Device, updev model.DeviceUpdate) error
func (*DataStoreMongo) WithAutomigrate ¶
func (db *DataStoreMongo) WithAutomigrate() store.DataStore
func (*DataStoreMongo) WithMultitenant ¶
func (db *DataStoreMongo) WithMultitenant() *DataStoreMongo