mysql

package
v0.0.0-...-bf7e782 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(db *sql.DB) *Store

func (*Store) CreateApplication

func (s *Store) CreateApplication(ctx context.Context, projectID, name, description string) (*models.Application, error)

func (*Store) CreateConnection

func (s *Store) CreateConnection(ctx context.Context, projectID, name string, protocol models.Protocol, port uint) (*models.Connection, error)

func (*Store) CreateDevice

func (s *Store) CreateDevice(ctx context.Context, projectID, name, deviceRegistrationTokenID string, deviceLabels, environmentVariables map[string]string) (*models.Device, error)

func (*Store) CreateDeviceAccessKey

func (s *Store) CreateDeviceAccessKey(ctx context.Context, projectID, deviceID, hash string) (*models.DeviceAccessKey, error)

func (*Store) CreateDeviceRegistrationToken

func (s *Store) CreateDeviceRegistrationToken(ctx context.Context, projectID, name, description string, maxRegistrations *int) (*models.DeviceRegistrationToken, error)

func (*Store) CreateExternalUser

func (s *Store) CreateExternalUser(ctx context.Context, providerName, providerID, email string, info map[string]interface{}) (*models.ExternalUser, error)

func (*Store) CreateInternalUser

func (s *Store) CreateInternalUser(ctx context.Context, email, passwordHash string) (*models.InternalUser, error)

func (*Store) CreateMembership

func (s *Store) CreateMembership(ctx context.Context, userID, projectID string) (*models.Membership, error)

func (*Store) CreateMembershipRoleBinding

func (s *Store) CreateMembershipRoleBinding(ctx context.Context, userID, roleID, projectID string) (*models.MembershipRoleBinding, error)

func (*Store) CreatePasswordRecoveryToken

func (s *Store) CreatePasswordRecoveryToken(ctx context.Context, userID, hash string) (*models.PasswordRecoveryToken, error)

func (*Store) CreateProject

func (s *Store) CreateProject(ctx context.Context, name string) (*models.Project, error)

func (*Store) CreateRegistrationToken

func (s *Store) CreateRegistrationToken(ctx context.Context, internalUserID, hash string) (*models.RegistrationToken, error)

func (*Store) CreateRelease

func (s *Store) CreateRelease(ctx context.Context, projectID, applicationID, yamlConfig, jsonConfig, createdByUserID, createdByServiceAccountID string) (*models.Release, error)

func (*Store) CreateRole

func (s *Store) CreateRole(ctx context.Context, projectID, name, description, config string) (*models.Role, error)

func (*Store) CreateServiceAccount

func (s *Store) CreateServiceAccount(ctx context.Context, projectID, name, description string) (*models.ServiceAccount, error)

func (*Store) CreateServiceAccountAccessKey

func (s *Store) CreateServiceAccountAccessKey(ctx context.Context, projectID, serviceAccountID, hash, description string) (*models.ServiceAccountAccessKey, error)

func (*Store) CreateServiceAccountRoleBinding

func (s *Store) CreateServiceAccountRoleBinding(ctx context.Context, serviceAccountID, roleID, projectID string) (*models.ServiceAccountRoleBinding, error)

func (*Store) CreateSession

func (s *Store) CreateSession(ctx context.Context, userID, hash string) (*models.Session, error)

func (*Store) CreateUserAccessKey

func (s *Store) CreateUserAccessKey(ctx context.Context, userID, hash, description string) (*models.UserAccessKey, error)

func (*Store) DeleteApplication

func (s *Store) DeleteApplication(ctx context.Context, id, projectID string) error

func (*Store) DeleteConnection

func (s *Store) DeleteConnection(ctx context.Context, id, projectID string) error

func (*Store) DeleteDevice

func (s *Store) DeleteDevice(ctx context.Context, id, projectID string) error

func (*Store) DeleteDeviceApplicationStatus

func (s *Store) DeleteDeviceApplicationStatus(ctx context.Context, projectID, deviceID, applicationID string) error

func (*Store) DeleteDeviceEnvironmentVariable

func (s *Store) DeleteDeviceEnvironmentVariable(ctx context.Context, deviceID, projectID, key string) error

func (*Store) DeleteDeviceLabel

func (s *Store) DeleteDeviceLabel(ctx context.Context, deviceID, projectID, key string) error

func (*Store) DeleteDeviceRegistrationToken

func (s *Store) DeleteDeviceRegistrationToken(ctx context.Context, id, projectID string) error

func (*Store) DeleteDeviceRegistrationTokenEnvironmentVariable

func (s *Store) DeleteDeviceRegistrationTokenEnvironmentVariable(ctx context.Context, tokenID, projectID, key string) error

func (*Store) DeleteDeviceRegistrationTokenLabel

func (s *Store) DeleteDeviceRegistrationTokenLabel(ctx context.Context, deviceRegistrationTokenID, projectID, key string) error

func (*Store) DeleteDeviceServiceState

func (s *Store) DeleteDeviceServiceState(ctx context.Context, projectID, deviceID, applicationID, service string) error

func (*Store) DeleteDeviceServiceStatus

func (s *Store) DeleteDeviceServiceStatus(ctx context.Context, projectID, deviceID, applicationID, service string) error

func (*Store) DeleteInternalUser

func (s *Store) DeleteInternalUser(ctx context.Context, id string) error

func (*Store) DeleteMembership

func (s *Store) DeleteMembership(ctx context.Context, userID, projectID string) error

func (*Store) DeleteMembershipRoleBinding

func (s *Store) DeleteMembershipRoleBinding(ctx context.Context, userID, roleID, projectID string) error

func (*Store) DeleteProject

func (s *Store) DeleteProject(ctx context.Context, id string) error

func (*Store) DeleteRole

func (s *Store) DeleteRole(ctx context.Context, id, projectID string) error

func (*Store) DeleteServiceAccount

func (s *Store) DeleteServiceAccount(ctx context.Context, id, projectID string) error

func (*Store) DeleteServiceAccountAccessKey

func (s *Store) DeleteServiceAccountAccessKey(ctx context.Context, id, projectID string) error

func (*Store) DeleteServiceAccountRoleBinding

func (s *Store) DeleteServiceAccountRoleBinding(ctx context.Context, serviceAccountID, roleID, projectID string) error

func (*Store) DeleteSession

func (s *Store) DeleteSession(ctx context.Context, id string) error

func (*Store) DeleteUserAccessKey

func (s *Store) DeleteUserAccessKey(ctx context.Context, id string) error

func (*Store) DeleteUserByInternalID

func (s *Store) DeleteUserByInternalID(ctx context.Context, internalUserID string) error

func (*Store) GetApplication

func (s *Store) GetApplication(ctx context.Context, id, projectID string) (*models.Application, error)

func (*Store) GetApplicationDeviceCounts

func (s *Store) GetApplicationDeviceCounts(ctx context.Context, projectID, applicationID string) (*models.ApplicationDeviceCounts, error)

func (*Store) GetConnection

func (s *Store) GetConnection(ctx context.Context, id, projectID string) (*models.Connection, error)

func (*Store) GetDevice

func (s *Store) GetDevice(ctx context.Context, id, projectID string) (*models.Device, error)

func (*Store) GetDeviceAccessKey

func (s *Store) GetDeviceAccessKey(ctx context.Context, id, projectID string) (*models.DeviceAccessKey, error)

func (*Store) GetDeviceApplicationStatus

func (s *Store) GetDeviceApplicationStatus(ctx context.Context, projectID, deviceID, applicationID string) (*models.DeviceApplicationStatus, error)

func (*Store) GetDeviceMetricsConfig

func (s *Store) GetDeviceMetricsConfig(ctx context.Context, projectID string) (*models.DeviceMetricsConfig, error)

func (*Store) GetDeviceRegistrationToken

func (s *Store) GetDeviceRegistrationToken(ctx context.Context, id, projectID string) (*models.DeviceRegistrationToken, error)

func (*Store) GetDeviceServiceState

func (s *Store) GetDeviceServiceState(ctx context.Context, projectID, deviceID, applicationID, service string) (*models.DeviceServiceState, error)

func (*Store) GetDeviceServiceStates

func (s *Store) GetDeviceServiceStates(ctx context.Context, projectID, deviceID, applicationID string) ([]models.DeviceServiceState, error)

func (*Store) GetDeviceServiceStatus

func (s *Store) GetDeviceServiceStatus(ctx context.Context, projectID, deviceID, applicationID, service string) (*models.DeviceServiceStatus, error)

func (*Store) GetDeviceServiceStatuses

func (s *Store) GetDeviceServiceStatuses(ctx context.Context, projectID, deviceID, applicationID string) ([]models.DeviceServiceStatus, error)

func (*Store) GetDevicesRegisteredWithTokenCount

func (s *Store) GetDevicesRegisteredWithTokenCount(ctx context.Context, tokenID, projectID string) (*models.DevicesRegisteredWithTokenCount, error)

func (*Store) GetExternalUser

func (s *Store) GetExternalUser(ctx context.Context, id string) (*models.ExternalUser, error)

func (*Store) GetExternalUserByProviderID

func (s *Store) GetExternalUserByProviderID(ctx context.Context, providerName, providerID string) (*models.ExternalUser, error)

func (*Store) GetInternalUser

func (s *Store) GetInternalUser(ctx context.Context, id string) (*models.InternalUser, error)

func (*Store) GetLatestRelease

func (s *Store) GetLatestRelease(ctx context.Context, projectID, applicationID string) (*models.Release, error)

func (*Store) GetMembership

func (s *Store) GetMembership(ctx context.Context, userID, projectID string) (*models.Membership, error)

func (*Store) GetMembershipRoleBinding

func (s *Store) GetMembershipRoleBinding(ctx context.Context, userID, roleID, projectID string) (*models.MembershipRoleBinding, error)

func (*Store) GetPasswordRecoveryToken

func (s *Store) GetPasswordRecoveryToken(ctx context.Context, id string) (*models.PasswordRecoveryToken, error)

func (*Store) GetProject

func (s *Store) GetProject(ctx context.Context, id string) (*models.Project, error)

func (*Store) GetProjectApplicationCounts

func (s *Store) GetProjectApplicationCounts(ctx context.Context, projectID string) (*models.ProjectApplicationCounts, error)

func (*Store) GetProjectDeviceCounts

func (s *Store) GetProjectDeviceCounts(ctx context.Context, projectID string) (*models.ProjectDeviceCounts, error)

func (*Store) GetProjectMetricsConfig

func (s *Store) GetProjectMetricsConfig(ctx context.Context, projectID string) (*models.ProjectMetricsConfig, error)

func (*Store) GetRegistrationToken

func (s *Store) GetRegistrationToken(ctx context.Context, id string) (*models.RegistrationToken, error)

func (*Store) GetRelease

func (s *Store) GetRelease(ctx context.Context, id, projectID, applicationID string) (*models.Release, error)

func (*Store) GetReleaseByNumber

func (s *Store) GetReleaseByNumber(ctx context.Context, number uint32, projectID, applicationID string) (*models.Release, error)

func (*Store) GetReleaseDeviceCounts

func (s *Store) GetReleaseDeviceCounts(ctx context.Context, projectID, applicationID, releaseID string) (*models.ReleaseDeviceCounts, error)

func (*Store) GetRole

func (s *Store) GetRole(ctx context.Context, id, projectID string) (*models.Role, error)

func (*Store) GetServiceAccount

func (s *Store) GetServiceAccount(ctx context.Context, id, projectID string) (*models.ServiceAccount, error)

func (*Store) GetServiceAccountAccessKey

func (s *Store) GetServiceAccountAccessKey(ctx context.Context, id, projectID string) (*models.ServiceAccountAccessKey, error)

func (*Store) GetServiceAccountRoleBinding

func (s *Store) GetServiceAccountRoleBinding(ctx context.Context, serviceAccountID, roleID, projectID string) (*models.ServiceAccountRoleBinding, error)

func (*Store) GetServiceMetricsConfigs

func (s *Store) GetServiceMetricsConfigs(ctx context.Context, projectID string) ([]models.ServiceMetricsConfig, error)

func (*Store) GetSession

func (s *Store) GetSession(ctx context.Context, id string) (*models.Session, error)

func (*Store) GetUser

func (s *Store) GetUser(ctx context.Context, id string) (*models.User, error)

func (*Store) GetUserAccessKey

func (s *Store) GetUserAccessKey(ctx context.Context, id string) (*models.UserAccessKey, error)

func (*Store) GetUserByExternalID

func (s *Store) GetUserByExternalID(ctx context.Context, externalUserID string) (*models.User, error)

func (*Store) GetUserByInternalID

func (s *Store) GetUserByInternalID(ctx context.Context, internalUserID string) (*models.User, error)

func (*Store) InitializeUser

func (s *Store) InitializeUser(ctx context.Context, internalUserID, externalUserID *string) (*models.User, error)

func (*Store) ListAllDeviceApplicationStatuses

func (s *Store) ListAllDeviceApplicationStatuses(ctx context.Context, projectID string) ([]models.DeviceApplicationStatus, error)

func (*Store) ListAllDeviceLabelKeys

func (s *Store) ListAllDeviceLabelKeys(ctx context.Context, projectID string) ([]string, error)

func (*Store) ListAllDeviceServiceStates

func (s *Store) ListAllDeviceServiceStates(ctx context.Context, projectID string) ([]models.DeviceServiceState, error)

func (*Store) ListApplicationServiceStateCounts

func (s *Store) ListApplicationServiceStateCounts(ctx context.Context, projectID, applicationID string) ([]models.ServiceStateCount, error)

func (*Store) ListApplications

func (s *Store) ListApplications(ctx context.Context, projectID string) ([]models.Application, error)

func (*Store) ListConnections

func (s *Store) ListConnections(ctx context.Context, projectID string) ([]models.Connection, error)

func (*Store) ListDeviceApplicationStatuses

func (s *Store) ListDeviceApplicationStatuses(ctx context.Context, projectID, deviceID string) ([]models.DeviceApplicationStatus, error)

func (*Store) ListDeviceRegistrationTokens

func (s *Store) ListDeviceRegistrationTokens(ctx context.Context, projectID string) ([]models.DeviceRegistrationToken, error)

func (*Store) ListDeviceServiceStates

func (s *Store) ListDeviceServiceStates(ctx context.Context, projectID, deviceID string) ([]models.DeviceServiceState, error)

func (*Store) ListDeviceServiceStatuses

func (s *Store) ListDeviceServiceStatuses(ctx context.Context, projectID, deviceID string) ([]models.DeviceServiceStatus, error)

func (*Store) ListDevices

func (s *Store) ListDevices(ctx context.Context, projectID, searchQuery string) ([]models.Device, error)

func (*Store) ListMembershipRoleBindings

func (s *Store) ListMembershipRoleBindings(ctx context.Context, userID, projectID string) ([]models.MembershipRoleBinding, error)

func (*Store) ListMembershipsByProject

func (s *Store) ListMembershipsByProject(ctx context.Context, projectID string) ([]models.Membership, error)

func (*Store) ListMembershipsByUser

func (s *Store) ListMembershipsByUser(ctx context.Context, userID string) ([]models.Membership, error)

func (*Store) ListProjects

func (s *Store) ListProjects(ctx context.Context) ([]models.Project, error)

func (*Store) ListReleases

func (s *Store) ListReleases(ctx context.Context, projectID, applicationID string) ([]models.Release, error)

func (*Store) ListRoles

func (s *Store) ListRoles(ctx context.Context, projectID string) ([]models.Role, error)

func (*Store) ListServiceAccountAccessKeys

func (s *Store) ListServiceAccountAccessKeys(ctx context.Context, projectID, serviceAccountID string) ([]models.ServiceAccountAccessKey, error)

func (*Store) ListServiceAccountRoleBindings

func (s *Store) ListServiceAccountRoleBindings(ctx context.Context, serviceAccountID, projectID string) ([]models.ServiceAccountRoleBinding, error)

func (*Store) ListServiceAccounts

func (s *Store) ListServiceAccounts(ctx context.Context, projectID string) ([]models.ServiceAccount, error)

func (*Store) ListUserAccessKeys

func (s *Store) ListUserAccessKeys(ctx context.Context, projectID string) ([]models.UserAccessKey, error)

func (*Store) LookupApplication

func (s *Store) LookupApplication(ctx context.Context, name, projectID string) (*models.Application, error)

func (*Store) LookupConnection

func (s *Store) LookupConnection(ctx context.Context, name, projectID string) (*models.Connection, error)

func (*Store) LookupDevice

func (s *Store) LookupDevice(ctx context.Context, name, projectID string) (*models.Device, error)

func (*Store) LookupDeviceRegistrationToken

func (s *Store) LookupDeviceRegistrationToken(ctx context.Context, name, projectID string) (*models.DeviceRegistrationToken, error)

func (*Store) LookupInternalUser

func (s *Store) LookupInternalUser(ctx context.Context, email string) (*models.InternalUser, error)

func (*Store) LookupProject

func (s *Store) LookupProject(ctx context.Context, name string) (*models.Project, error)

func (*Store) LookupRole

func (s *Store) LookupRole(ctx context.Context, name, projectID string) (*models.Role, error)

func (*Store) LookupServiceAccount

func (s *Store) LookupServiceAccount(ctx context.Context, name, projectID string) (*models.ServiceAccount, error)

func (*Store) SetDeviceApplicationStatus

func (s *Store) SetDeviceApplicationStatus(ctx context.Context, projectID, deviceID, applicationID, currentReleaseID string) error

func (*Store) SetDeviceEnvironmentVariable

func (s *Store) SetDeviceEnvironmentVariable(ctx context.Context, deviceID, projectID, key, value string) (*string, error)

func (*Store) SetDeviceInfo

func (s *Store) SetDeviceInfo(ctx context.Context, id, projectID string, deviceInfo models.DeviceInfo) (*models.Device, error)

func (*Store) SetDeviceLabel

func (s *Store) SetDeviceLabel(ctx context.Context, deviceID, projectID, key, value string) (*string, error)

func (*Store) SetDeviceMetricsConfig

func (s *Store) SetDeviceMetricsConfig(ctx context.Context, projectID string, value models.DeviceMetricsConfig) error

func (*Store) SetDeviceRegistrationTokenEnvironmentVariable

func (s *Store) SetDeviceRegistrationTokenEnvironmentVariable(ctx context.Context, tokenID, projectID, key, value string) (*string, error)

func (*Store) SetDeviceRegistrationTokenLabel

func (s *Store) SetDeviceRegistrationTokenLabel(ctx context.Context, deviceRegistrationTokenID, projectID, key, value string) (*string, error)

func (*Store) SetDeviceServiceState

func (s *Store) SetDeviceServiceState(ctx context.Context, projectID, deviceID, applicationID, service string, state models.ServiceState, errorMessage string) error

func (*Store) SetDeviceServiceStatus

func (s *Store) SetDeviceServiceStatus(ctx context.Context, projectID, deviceID, applicationID, service, currentReleaseID string) error

func (*Store) SetProjectMetricsConfig

func (s *Store) SetProjectMetricsConfig(ctx context.Context, projectID string, value models.ProjectMetricsConfig) error

func (*Store) SetServiceMetricsConfigs

func (s *Store) SetServiceMetricsConfigs(ctx context.Context, projectID string, value []models.ServiceMetricsConfig) error

func (*Store) UpdateApplicationDescription

func (s *Store) UpdateApplicationDescription(ctx context.Context, id, projectID, description string) (*models.Application, error)

func (*Store) UpdateApplicationMetricEndpointConfigs

func (s *Store) UpdateApplicationMetricEndpointConfigs(ctx context.Context, id, projectID string, metricEndpointConfigs map[string]models.MetricEndpointConfig) (*models.Application, error)

func (*Store) UpdateApplicationName

func (s *Store) UpdateApplicationName(ctx context.Context, id, projectID, name string) (*models.Application, error)

func (*Store) UpdateApplicationSchedulingRule

func (s *Store) UpdateApplicationSchedulingRule(ctx context.Context, id, projectID string, schedulingRule models.SchedulingRule) (*models.Application, error)

func (*Store) UpdateConnection

func (s *Store) UpdateConnection(ctx context.Context, id, projectID, name string, protocol models.Protocol, port uint) (*models.Connection, error)

func (*Store) UpdateDeviceLastSeenAt

func (s *Store) UpdateDeviceLastSeenAt(ctx context.Context, projectID, deviceID string) error

func (*Store) UpdateDeviceName

func (s *Store) UpdateDeviceName(ctx context.Context, id, projectID, name string) (*models.Device, error)

func (*Store) UpdateDeviceRegistrationToken

func (s *Store) UpdateDeviceRegistrationToken(ctx context.Context, id, projectID, name, description string, maxRegistrations *int) (*models.DeviceRegistrationToken, error)

func (*Store) UpdateInternalUserPasswordHash

func (s *Store) UpdateInternalUserPasswordHash(ctx context.Context, id, passwordHash string) (*models.InternalUser, error)

func (*Store) UpdateProject

func (s *Store) UpdateProject(ctx context.Context, id, name, datadogApiKey string) (*models.Project, error)

func (*Store) UpdateRole

func (s *Store) UpdateRole(ctx context.Context, id, projectID, name, description, config string) (*models.Role, error)

func (*Store) UpdateServiceAccount

func (s *Store) UpdateServiceAccount(ctx context.Context, id, projectID, name, description string) (*models.ServiceAccount, error)

func (*Store) UpdateUserName

func (s *Store) UpdateUserName(ctx context.Context, id, name string) (*models.User, error)

func (*Store) ValidateDeviceAccessKey

func (s *Store) ValidateDeviceAccessKey(ctx context.Context, projectID, hash string) (*models.DeviceAccessKey, error)

func (*Store) ValidateInternalUser

func (s *Store) ValidateInternalUser(ctx context.Context, id, passwordHash string) (*models.InternalUser, error)

func (*Store) ValidateInternalUserWithEmail

func (s *Store) ValidateInternalUserWithEmail(ctx context.Context, email, passwordHash string) (*models.InternalUser, error)

func (*Store) ValidatePasswordRecoveryToken

func (s *Store) ValidatePasswordRecoveryToken(ctx context.Context, hash string) (*models.PasswordRecoveryToken, error)

func (*Store) ValidateRegistrationToken

func (s *Store) ValidateRegistrationToken(ctx context.Context, hash string) (*models.RegistrationToken, error)

func (*Store) ValidateServiceAccountAccessKey

func (s *Store) ValidateServiceAccountAccessKey(ctx context.Context, hash string) (*models.ServiceAccountAccessKey, error)

func (*Store) ValidateSession

func (s *Store) ValidateSession(ctx context.Context, hash string) (*models.Session, error)

func (*Store) ValidateUserAccessKey

func (s *Store) ValidateUserAccessKey(ctx context.Context, hash string) (*models.UserAccessKey, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL