Documentation
¶
Index ¶
- Constants
- func ImportProjectFromYAML(yamlStr string, projectID uuid.UUID, userID uuid.UUID) error
- func ValidateProjectImportYAML(yamlStr string, projectID uuid.UUID) []string
- type AppDBSerializerStruct
- type AppImport
- type AppObject
- type AppResourceMessageObject
- type AppUsageDBSerializerStruct
- type AppUsageMatrixReader
- type AppUsageMatrixResponse
- type AppUsageResourceDBSerializerStruct
- type AppsObjectsManager
- func (appsManager *AppsObjectsManager) CanNameBeUsed(name string, projectID uuid.UUID) bool
- func (appsManager *AppsObjectsManager) CreateANewApp(name string, description string, projectID uuid.UUID, ...) (*AppObject, error)
- func (appsManager *AppsObjectsManager) GetAllAppsForProject(projectID uuid.UUID) ([]AppObject, error)
- func (manager *AppsObjectsManager) GetAppUsage(appID uuid.UUID) (*AppUsageDBSerializerStruct, error)
- func (manager *AppsObjectsManager) GetAppUsageMatrix(appID uuid.UUID) (*AppUsageMatrixResponse, error)
- func (appsManager *AppsObjectsManager) GetByID(id uuid.UUID) (*AppObject, error)
- type AppsResourcesMessagesObjectsManager
- func (manager *AppsResourcesMessagesObjectsManager) ConnectionExists(appID uuid.UUID, resourceID uuid.UUID, messageID uuid.UUID, direction string) bool
- func (manager *AppsResourcesMessagesObjectsManager) CreateConnection(appID uuid.UUID, resourceID uuid.UUID, messageID uuid.UUID, direction string, ...) (*AppResourceMessageObject, error)
- func (manager *AppsResourcesMessagesObjectsManager) GetAllForApp(appID uuid.UUID) ([]*AppResourceMessageObject, error)
- type BindImport
- type MessageDBSerializerStruct
- type MessageImport
- type MessageObject
- type MessagesObjectsManager
- func (messagesManager *MessagesObjectsManager) CanNameBeUsed(name string, projectID uuid.UUID) bool
- func (messagesManager *MessagesObjectsManager) CreateANewMessage(description string, userID uuid.UUID, projectID uuid.UUID, name string, ...) (*MessageObject, error)
- func (messagesManager *MessagesObjectsManager) GetAllMessagesInProject(projectID uuid.UUID) ([]MessageObject, error)
- func (messagesManager *MessagesObjectsManager) GetByID(messageID uuid.UUID) (*MessageObject, error)
- type ProjectDBSerializerStruct
- type ProjectImportYAML
- type ProjectObject
- type ProjectsObjectsManager
- func (projectsManager *ProjectsObjectsManager) CheckIfProjectWithSpecificNameExists(name string) bool
- func (projectsManager *ProjectsObjectsManager) CreateANewProject(name string, description string, createdById uuid.UUID) (*ProjectObject, error)
- func (projectsManager *ProjectsObjectsManager) GetAllProjects(myID uuid.UUID) ([]ProjectObject, error)
- func (projectsManager *ProjectsObjectsManager) GetByID(id uuid.UUID) (*ProjectObject, error)
- type ReceiveImport
- type ResourceBindingDBSerializerStruct
- type ResourceBindingObject
- type ResourceBindingsObjectsManager
- func (manager *ResourceBindingsObjectsManager) CheckIfBindingExists(sourceResourceID, targetResourceID uuid.UUID) bool
- func (manager *ResourceBindingsObjectsManager) CreateABinding(sourceResourceID uuid.UUID, targetResourceID uuid.UUID) (*ResourceBindingObject, error)
- func (manager *ResourceBindingsObjectsManager) GetAllBindingsForResource(resourceID uuid.UUID) ([]ResourceBindingObject, error)
- func (manager *ResourceBindingsObjectsManager) GetByID(id uuid.UUID) (*ResourceBindingObject, error)
- type ResourceDBSerializerStruct
- type ResourceImport
- type ResourceObject
- type ResourcesObjectsManager
- func (manager *ResourcesObjectsManager) CanNameBeUsed(name string, serverID uuid.UUID) bool
- func (manager *ResourcesObjectsManager) CreateANewResource(serverID uuid.UUID, projectID uuid.UUID, name string, mode string, ...) (*ResourceObject, error)
- func (manager *ResourcesObjectsManager) GetAllResourcesForServer(serverID uuid.UUID) ([]ResourceObject, error)
- func (manager *ResourcesObjectsManager) GetByID(id uuid.UUID) (*ResourceObject, error)
- type SchemaDBSerializerStruct
- type SchemaEditDBSerializerStruct
- type SchemaEditShortDBSerializerStruct
- type SchemaImport
- type SchemaObject
- func (schema *SchemaObject) CreateANewVersion(newSchemaContent string, userID uuid.UUID) (*SchemaObject, error)
- func (schema *SchemaObject) GenerateCode(language string) (generatedCode string, structName string, err error)
- func (schemaObject *SchemaObject) GetAllVersions() []*SchemaVersionObject
- func (schema *SchemaObject) GetCurrentVersion() int
- func (schema *SchemaObject) GetID() uuid.UUID
- func (schema *SchemaObject) GetLatestVersion() int
- func (schema *SchemaObject) GetName() string
- func (schema *SchemaObject) GetProjectID() uuid.UUID
- func (schema *SchemaObject) GetType() string
- func (schema *SchemaObject) Serialize() *SchemaDBSerializerStruct
- type SchemaObjectsManager
- func (schemaManager *SchemaObjectsManager) CanNameBeUsed(name string, projectID uuid.UUID) bool
- func (schemaManager *SchemaObjectsManager) CheckIfThisSchemaNameAlreadyExists(ProjectID uuid.UUID, name string) bool
- func (schemaManager *SchemaObjectsManager) CreateANewSchema(name string, description string, schema string, schemaType string, ...) (*SchemaObject, error)
- func (schemaManager *SchemaObjectsManager) GetAllSchemasInProject(ProjectID uuid.UUID) []SchemaObject
- func (schemaManager *SchemaObjectsManager) GetByID(schemaID uuid.UUID) (*SchemaObject, error)
- func (schemaManager *SchemaObjectsManager) GetSpecificVersionOfSchema(schemaID uuid.UUID, version int) (*SchemaVersionObject, error)
- func (schemaManager *SchemaObjectsManager) SchemaWithVersionExists(schemaID uuid.UUID, schemaVersion int) bool
- type SchemaReference
- type SchemaVersionObject
- func (schemaVersion *SchemaVersionObject) GenerateCode(language string, schemaType string, schemaName string) (generatedCode string, structName string, err error)
- func (schemaEditObject *SchemaVersionObject) SerializeLong() *SchemaEditDBSerializerStruct
- func (schemaEditObject *SchemaVersionObject) SerializeShort() *SchemaEditShortDBSerializerStruct
- type SendImport
- type ServerDBSerializerStruct
- type ServerImport
- type ServerObject
- type ServersObjectsManager
- func (manager *ServersObjectsManager) CanNameBeUsed(name string, projectID uuid.UUID) bool
- func (manager *ServersObjectsManager) CreateANewServer(name string, description string, protocol string, projectID uuid.UUID, ...) (*ServerObject, error)
- func (manager *ServersObjectsManager) GetAllServersForProject(projectID uuid.UUID) ([]ServerObject, error)
- func (manager *ServersObjectsManager) GetByID(id uuid.UUID) (*ServerObject, error)
- type UserDBSerializerStruct
- type UserObject
- type UserObjectsManager
Constants ¶
const (
STATUS_ACTIVE = "active"
)
Variables ¶
This section is empty.
Functions ¶
func ImportProjectFromYAML ¶
ImportProjectFromYAML imports the project architecture from YAML
Types ¶
type AppDBSerializerStruct ¶
type AppDBSerializerStruct struct {
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
Description string `json:"description"`
ProjectID string `json:"project_id"`
CreatedByUserID string `json:"created_by_user_id"`
CreatedByUserName string `json:"created_by_user_name"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type AppImport ¶
type AppImport struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Sends []SendImport `yaml:"sends,omitempty"`
Receives []ReceiveImport `yaml:"receives,omitempty"`
}
type AppObject ¶
type AppObject struct {
// contains filtered or unexported fields
}
func (*AppObject) Serialize ¶
func (app *AppObject) Serialize() *AppDBSerializerStruct
type AppResourceMessageObject ¶
type AppResourceMessageObject struct {
// contains filtered or unexported fields
}
AppResourceMessageObject represents a relationship between an app, resource, and message
func (*AppResourceMessageObject) GetAppID ¶
func (arm *AppResourceMessageObject) GetAppID() uuid.UUID
GetAppID returns the app ID
func (*AppResourceMessageObject) GetDirection ¶
func (arm *AppResourceMessageObject) GetDirection() string
GetDirection returns the direction (sends/receives)
func (*AppResourceMessageObject) GetMessageID ¶
func (arm *AppResourceMessageObject) GetMessageID() uuid.UUID
GetMessageID returns the message ID
func (*AppResourceMessageObject) GetResourceID ¶
func (arm *AppResourceMessageObject) GetResourceID() uuid.UUID
GetResourceID returns the resource ID
func (*AppResourceMessageObject) GetStatus ¶
func (arm *AppResourceMessageObject) GetStatus() string
GetStatus returns the status
type AppUsageDBSerializerStruct ¶
type AppUsageDBSerializerStruct struct {
AppID string `json:"app_id"`
Usage []AppUsageResourceDBSerializerStruct `json:"usage"`
}
AppUsageDBSerializerStruct represents the usage for an app
type AppUsageMatrixReader ¶
type AppUsageMatrixReader struct {
Resource *ResourceDBSerializerStruct `json:"resource"`
Server *ServerDBSerializerStruct `json:"server"`
Message *MessageDBSerializerStruct `json:"message"`
}
AppUsageMatrixReader represents a single connection in the usage matrix
type AppUsageMatrixResponse ¶
type AppUsageMatrixResponse struct {
AppID string `json:"app_id"`
Sends []AppUsageMatrixReader `json:"sends"`
Receives []AppUsageMatrixReader `json:"receives"`
}
AppUsageMatrixResponse represents the app usage matrix
type AppUsageResourceDBSerializerStruct ¶
type AppUsageResourceDBSerializerStruct struct {
Resource *ResourceDBSerializerStruct `json:"resource"`
Server *ServerDBSerializerStruct `json:"server"`
Message *MessageDBSerializerStruct `json:"message"`
Direction string `json:"direction"` // "receives" or "sends"
}
AppUsageResourceDBSerializerStruct represents a single usage record
type AppsObjectsManager ¶
type AppsObjectsManager struct {
}
func (*AppsObjectsManager) CanNameBeUsed ¶
func (appsManager *AppsObjectsManager) CanNameBeUsed(name string, projectID uuid.UUID) bool
func (*AppsObjectsManager) CreateANewApp ¶
func (*AppsObjectsManager) GetAllAppsForProject ¶
func (appsManager *AppsObjectsManager) GetAllAppsForProject( projectID uuid.UUID) ([]AppObject, error)
func (*AppsObjectsManager) GetAppUsage ¶
func (manager *AppsObjectsManager) GetAppUsage(appID uuid.UUID) (*AppUsageDBSerializerStruct, error)
GetAppUsage gets the usage information for an app
func (*AppsObjectsManager) GetAppUsageMatrix ¶
func (manager *AppsObjectsManager) GetAppUsageMatrix(appID uuid.UUID) (*AppUsageMatrixResponse, error)
GetAppUsageMatrix gets the usage matrix for an app
type AppsResourcesMessagesObjectsManager ¶
type AppsResourcesMessagesObjectsManager struct {
}
AppsResourcesMessagesObjectsManager manages app-resource-message relationships
func (*AppsResourcesMessagesObjectsManager) ConnectionExists ¶
func (manager *AppsResourcesMessagesObjectsManager) ConnectionExists( appID uuid.UUID, resourceID uuid.UUID, messageID uuid.UUID, direction string, ) bool
ConnectionExists checks if a connection already exists
func (*AppsResourcesMessagesObjectsManager) CreateConnection ¶
func (manager *AppsResourcesMessagesObjectsManager) CreateConnection( appID uuid.UUID, resourceID uuid.UUID, messageID uuid.UUID, direction string, createdByUserID uuid.UUID, ) (*AppResourceMessageObject, error)
CreateConnection creates a new app-resource-message connection
func (*AppsResourcesMessagesObjectsManager) GetAllForApp ¶
func (manager *AppsResourcesMessagesObjectsManager) GetAllForApp(appID uuid.UUID) ([]*AppResourceMessageObject, error)
GetAllForApp retrieves all app resource messages for a specific app
type BindImport ¶
type MessageDBSerializerStruct ¶
type MessageDBSerializerStruct struct {
ID string `json:"id"`
ProjectID string `json:"project_id"`
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
SchemaID string `json:"schema_id"`
SchemaVersion int `json:"schema_version"`
CreatedByID string `json:"created_by_id"`
CreatedByName string `json:"created_by_name"`
CreatedAt string `json:"created_at"`
}
type MessageImport ¶
type MessageImport struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Schema SchemaReference `yaml:"schema"`
}
type MessageObject ¶
type MessageObject struct {
// contains filtered or unexported fields
}
func (*MessageObject) GetID ¶
func (message *MessageObject) GetID() uuid.UUID
GetID returns the ID of the message
func (*MessageObject) GetProjectID ¶
func (message *MessageObject) GetProjectID() uuid.UUID
GetProjectID returns the project ID of the message
func (*MessageObject) GetSchemaID ¶
func (message *MessageObject) GetSchemaID() uuid.UUID
GetSchemaID returns the schema ID for this message
func (*MessageObject) GetSchemaVersion ¶
func (message *MessageObject) GetSchemaVersion() int
GetSchemaVersion returns the schema version for this message
func (*MessageObject) Serialize ¶
func (message *MessageObject) Serialize() *MessageDBSerializerStruct
Serialize converts a MessageObject to its serialized form
type MessagesObjectsManager ¶
type MessagesObjectsManager struct{}
func (*MessagesObjectsManager) CanNameBeUsed ¶
func (messagesManager *MessagesObjectsManager) CanNameBeUsed(name string, projectID uuid.UUID) bool
CanNameBeUsed checks if a message name can be used in a project
func (*MessagesObjectsManager) CreateANewMessage ¶
func (messagesManager *MessagesObjectsManager) CreateANewMessage( description string, userID uuid.UUID, projectID uuid.UUID, name string, schemaID uuid.UUID, schemaVersion int, ) (*MessageObject, error)
CreateANewMessage creates a new message in the database
func (*MessagesObjectsManager) GetAllMessagesInProject ¶
func (messagesManager *MessagesObjectsManager) GetAllMessagesInProject(projectID uuid.UUID) ([]MessageObject, error)
GetAllMessagesInProject retrieves all messages in a project
func (*MessagesObjectsManager) GetByID ¶
func (messagesManager *MessagesObjectsManager) GetByID(messageID uuid.UUID) (*MessageObject, error)
GetByID retrieves a message by its ID
type ProjectDBSerializerStruct ¶
type ProjectDBSerializerStruct struct {
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
IsPrivate bool `json:"is_private"`
Description string `json:"description"`
CreatedByType string `json:"created_by_type"`
CreatedByID string `json:"created_by_id"`
CreatedByName string `json:"created_by_name"`
}
type ProjectImportYAML ¶
type ProjectImportYAML struct {
Version int `yaml:"version"`
Servers []ServerImport `yaml:"servers"`
Schemas []SchemaImport `yaml:"schemas"`
Messages []MessageImport `yaml:"messages"`
Apps []AppImport `yaml:"apps"`
}
YAML structures for project import
type ProjectObject ¶
type ProjectObject struct {
// contains filtered or unexported fields
}
ProjectObject represents a project in the system which is a container for all apps, schemas, and other resources. Projects are visible to all users, but can be private or public. Private projects are now supported, but not implemented yet.
func (*ProjectObject) GetID ¶
func (project *ProjectObject) GetID() uuid.UUID
func (*ProjectObject) Serialize ¶
func (project *ProjectObject) Serialize() *ProjectDBSerializerStruct
type ProjectsObjectsManager ¶
type ProjectsObjectsManager struct {
}
ProjectsObjectsManager manages project objects in the system. It accumulates functions which perform operations over multiple project objects, such as creating new projects, retrieving projects by ID or email, etc.
func (*ProjectsObjectsManager) CheckIfProjectWithSpecificNameExists ¶
func (projectsManager *ProjectsObjectsManager) CheckIfProjectWithSpecificNameExists(name string) bool
CheckIfProjectWithSpecificNameExists checks if a project with the given name exists Only one project with a specific name can exist for a user at a time.
func (*ProjectsObjectsManager) CreateANewProject ¶
func (projectsManager *ProjectsObjectsManager) CreateANewProject(name string, description string, createdById uuid.UUID) (*ProjectObject, error)
CreateANewProject creates a new project in the system.
func (*ProjectsObjectsManager) GetAllProjects ¶
func (projectsManager *ProjectsObjectsManager) GetAllProjects(myID uuid.UUID) ([]ProjectObject, error)
GetAllProjects retrieves all projects that are active in the system. Currently, returns both public and private projects.
func (*ProjectsObjectsManager) GetByID ¶
func (projectsManager *ProjectsObjectsManager) GetByID(id uuid.UUID) (*ProjectObject, error)
type ReceiveImport ¶
type ResourceBindingObject ¶
type ResourceBindingObject struct {
// contains filtered or unexported fields
}
func (*ResourceBindingObject) GetID ¶
func (binding *ResourceBindingObject) GetID() uuid.UUID
func (*ResourceBindingObject) Serialize ¶
func (binding *ResourceBindingObject) Serialize() *ResourceBindingDBSerializerStruct
type ResourceBindingsObjectsManager ¶
type ResourceBindingsObjectsManager struct {
}
func (*ResourceBindingsObjectsManager) CheckIfBindingExists ¶
func (manager *ResourceBindingsObjectsManager) CheckIfBindingExists(sourceResourceID, targetResourceID uuid.UUID) bool
func (*ResourceBindingsObjectsManager) CreateABinding ¶
func (manager *ResourceBindingsObjectsManager) CreateABinding( sourceResourceID uuid.UUID, targetResourceID uuid.UUID) (*ResourceBindingObject, error)
func (*ResourceBindingsObjectsManager) GetAllBindingsForResource ¶
func (manager *ResourceBindingsObjectsManager) GetAllBindingsForResource( resourceID uuid.UUID) ([]ResourceBindingObject, error)
func (*ResourceBindingsObjectsManager) GetByID ¶
func (manager *ResourceBindingsObjectsManager) GetByID(id uuid.UUID) (*ResourceBindingObject, error)
type ResourceDBSerializerStruct ¶
type ResourceDBSerializerStruct struct {
ID string `json:"id"`
ServerID string `json:"server_id"`
Name string `json:"name"`
Mode string `json:"mode"`
ResourceType string `json:"resource_type"`
Status string `json:"status"`
Description string `json:"description"`
ProjectID string `json:"project_id"`
CreatedByUserID string `json:"created_by_user_id"`
CreatedByUserName string `json:"created_by_user_name"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type ResourceImport ¶
type ResourceObject ¶
type ResourceObject struct {
// contains filtered or unexported fields
}
func (*ResourceObject) GetID ¶
func (resource *ResourceObject) GetID() uuid.UUID
func (*ResourceObject) GetServerID ¶
func (resource *ResourceObject) GetServerID() uuid.UUID
func (*ResourceObject) Serialize ¶
func (resource *ResourceObject) Serialize() *ResourceDBSerializerStruct
type ResourcesObjectsManager ¶
type ResourcesObjectsManager struct {
}
func (*ResourcesObjectsManager) CanNameBeUsed ¶
func (manager *ResourcesObjectsManager) CanNameBeUsed(name string, serverID uuid.UUID) bool
func (*ResourcesObjectsManager) CreateANewResource ¶
func (*ResourcesObjectsManager) GetAllResourcesForServer ¶
func (manager *ResourcesObjectsManager) GetAllResourcesForServer( serverID uuid.UUID) ([]ResourceObject, error)
func (*ResourcesObjectsManager) GetByID ¶
func (manager *ResourcesObjectsManager) GetByID(id uuid.UUID) (*ResourceObject, error)
type SchemaDBSerializerStruct ¶
type SchemaDBSerializerStruct struct {
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
Type string `json:"type"`
Description string `json:"description"`
CreatedByType string `json:"created_by_type"`
CreatedByID string `json:"created_by_id"`
ProjectID string `json:"project_id"`
CreatedByName string `json:"created_by_name"`
Schema string `json:"schema"`
Version int `json:"version"`
}
type SchemaImport ¶
type SchemaObject ¶
type SchemaObject struct {
// contains filtered or unexported fields
}
SchemaObject represents a schema in the system. It is heavily coupled with schema versions.
func (*SchemaObject) CreateANewVersion ¶
func (schema *SchemaObject) CreateANewVersion(newSchemaContent string, userID uuid.UUID) (*SchemaObject, error)
CreateANewVersion creates a new version of an existing schema
func (*SchemaObject) GenerateCode ¶
func (schema *SchemaObject) GenerateCode(language string) (generatedCode string, structName string, err error)
GenerateCode generates code from the schema in the specified language Returns the generated code and the name of the generated structure/class Requires JSON_SCHEMA_CONVERTOR_CMD environment variable to be set with the full path to quicktype
func (*SchemaObject) GetAllVersions ¶
func (schemaObject *SchemaObject) GetAllVersions() []*SchemaVersionObject
func (*SchemaObject) GetCurrentVersion ¶
func (schema *SchemaObject) GetCurrentVersion() int
func (*SchemaObject) GetID ¶
func (schema *SchemaObject) GetID() uuid.UUID
func (*SchemaObject) GetLatestVersion ¶
func (schema *SchemaObject) GetLatestVersion() int
func (*SchemaObject) GetName ¶
func (schema *SchemaObject) GetName() string
func (*SchemaObject) GetProjectID ¶
func (schema *SchemaObject) GetProjectID() uuid.UUID
func (*SchemaObject) GetType ¶
func (schema *SchemaObject) GetType() string
func (*SchemaObject) Serialize ¶
func (schema *SchemaObject) Serialize() *SchemaDBSerializerStruct
type SchemaObjectsManager ¶
type SchemaObjectsManager struct {
}
SchemaObjectsManager manages schemas and schema versions together
func (*SchemaObjectsManager) CanNameBeUsed ¶
func (schemaManager *SchemaObjectsManager) CanNameBeUsed(name string, projectID uuid.UUID) bool
CanNameBeUsed checks if a schema name can be used in a project
func (*SchemaObjectsManager) CheckIfThisSchemaNameAlreadyExists ¶
func (schemaManager *SchemaObjectsManager) CheckIfThisSchemaNameAlreadyExists(ProjectID uuid.UUID, name string) bool
CheckIfThisSchemaNameAlreadyExists checks if a schema with the given name already exists in the project. Users can refer to schemas by name, so we need to ensure that the name is unique in order to avoid confusion.
func (*SchemaObjectsManager) CreateANewSchema ¶
func (schemaManager *SchemaObjectsManager) CreateANewSchema(name string, description string, schema string, schemaType string, createdByType string, createdById uuid.UUID, userID uuid.UUID, projectID uuid.UUID, ) (*SchemaObject, error)
CreateANewSchema creates a new schema in the database. Creation of schema also creates a new schema version.
func (*SchemaObjectsManager) GetAllSchemasInProject ¶
func (schemaManager *SchemaObjectsManager) GetAllSchemasInProject(ProjectID uuid.UUID) []SchemaObject
func (*SchemaObjectsManager) GetByID ¶
func (schemaManager *SchemaObjectsManager) GetByID(schemaID uuid.UUID) (*SchemaObject, error)
GetByID retrieves a schema by its ID
func (*SchemaObjectsManager) GetSpecificVersionOfSchema ¶
func (schemaManager *SchemaObjectsManager) GetSpecificVersionOfSchema(schemaID uuid.UUID, version int) (*SchemaVersionObject, error)
GetSpecificVersionOfSchema retrieves a specific version of a schema
func (*SchemaObjectsManager) SchemaWithVersionExists ¶
func (schemaManager *SchemaObjectsManager) SchemaWithVersionExists(schemaID uuid.UUID, schemaVersion int) bool
SchemaWithVersionExists checks if a schema with the specific ID and version exists and is active
type SchemaReference ¶
type SchemaReference struct {
Name string `yaml:"name"`
}
type SchemaVersionObject ¶
type SchemaVersionObject struct {
// contains filtered or unexported fields
}
SchemaVersionObject represents a version of a schema.
func (*SchemaVersionObject) GenerateCode ¶
func (schemaVersion *SchemaVersionObject) GenerateCode(language string, schemaType string, schemaName string) (generatedCode string, structName string, err error)
GenerateCode generates code from this schema version in the specified language Returns the generated code and the name of the generated structure/class Requires JSON_SCHEMA_CONVERTOR_CMD environment variable to be set with the full path to quicktype
func (*SchemaVersionObject) SerializeLong ¶
func (schemaEditObject *SchemaVersionObject) SerializeLong() *SchemaEditDBSerializerStruct
func (*SchemaVersionObject) SerializeShort ¶
func (schemaEditObject *SchemaVersionObject) SerializeShort() *SchemaEditShortDBSerializerStruct
type SendImport ¶
type ServerDBSerializerStruct ¶
type ServerDBSerializerStruct struct {
ID string `json:"id"`
Name string `json:"name"`
Protocol string `json:"protocol"`
Status string `json:"status"`
Description string `json:"description"`
ProjectID string `json:"project_id"`
CreatedByUserID string `json:"created_by_user_id"`
CreatedByUserName string `json:"created_by_user_name"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type ServerImport ¶
type ServerImport struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Description string `yaml:"description"`
Resources []ResourceImport `yaml:"resources"`
Binds []BindImport `yaml:"binds,omitempty"`
}
type ServerObject ¶
type ServerObject struct {
// contains filtered or unexported fields
}
func (*ServerObject) GetID ¶
func (server *ServerObject) GetID() uuid.UUID
func (*ServerObject) GetProjectID ¶
func (server *ServerObject) GetProjectID() uuid.UUID
func (*ServerObject) Serialize ¶
func (server *ServerObject) Serialize() *ServerDBSerializerStruct
type ServersObjectsManager ¶
type ServersObjectsManager struct {
}
func (*ServersObjectsManager) CanNameBeUsed ¶
func (manager *ServersObjectsManager) CanNameBeUsed(name string, projectID uuid.UUID) bool
func (*ServersObjectsManager) CreateANewServer ¶
func (manager *ServersObjectsManager) CreateANewServer( name string, description string, protocol string, projectID uuid.UUID, createdByUserID uuid.UUID) (*ServerObject, error)
func (*ServersObjectsManager) GetAllServersForProject ¶
func (manager *ServersObjectsManager) GetAllServersForProject( projectID uuid.UUID) ([]ServerObject, error)
func (*ServersObjectsManager) GetByID ¶
func (manager *ServersObjectsManager) GetByID(id uuid.UUID) (*ServerObject, error)
type UserDBSerializerStruct ¶
type UserObject ¶
type UserObject struct {
Model *db.UsersDBModel
}
UserObject represents a user in the system. It performs operations on a single user object, such as serialization, authentication, and other user-specific actions.
func (*UserObject) GetID ¶
func (user *UserObject) GetID() uuid.UUID
func (*UserObject) Serialize ¶
func (user *UserObject) Serialize() *UserDBSerializerStruct
func (*UserObject) VerifyPassword ¶
func (user *UserObject) VerifyPassword(password string) bool
VerifyPassword checks if the provided password matches the stored password hash.
type UserObjectsManager ¶
type UserObjectsManager struct {
}
UserObjectsManager manages user objects in the system. It accumulates functions which perform operations over multiple user objects, such as creating new users, retrieving users by ID or email, etc.
func (*UserObjectsManager) FindByEmail ¶
func (usersManager *UserObjectsManager) FindByEmail(email string) (*UserObject, error)
FindByEmail retrieves a user from the database by their email.
func (*UserObjectsManager) FindByID ¶
func (usersManager *UserObjectsManager) FindByID(id uuid.UUID) (*UserObject, error)
FindByID retrieves a user from the database by their ID.
func (*UserObjectsManager) RegisterNewUserWithEmailAndPassword ¶
func (usersManager *UserObjectsManager) RegisterNewUserWithEmailAndPassword(email string, password string) ( *UserObject, error)
RegisterNewUserWithEmailAndPassword creates a new user in the database with the provided email and password.