Documentation
¶
Index ¶
- Variables
- type Database
- func (d *Database) AgentShutdown(ctx context.Context, agentID string) error
- func (d *Database) AgentStartup(ctx context.Context, agentID string) error
- func (d *Database) AuthenticateAgent(ctx context.Context, key string, metadata *rpc.SystemMetadata) (agentID string, err error)
- func (d *Database) CanAccessProject(ctx context.Context, subject, projectId string) (bool, error)
- func (d *Database) CreateHostGroup(ctx context.Context, projectId, name, description string) (string, error)
- func (d *Database) CreateProject(ctx context.Context, subject, name, description string) (types.Project, error)
- func (d *Database) GeneratePreSharedKey(ctx context.Context, projectId string, exp time.Time) (key string, err error)
- func (d *Database) GetEventLogsByHost(ctx context.Context, hostId string, limit int) (out []types.AgentEventLog, err error)
- func (d *Database) GetHost(ctx context.Context, hostId, projectId string) (out types.Host, err error)
- func (d *Database) GetProjectMetrics(ctx context.Context, projectId string) (*types.ProjectMetrics, error)
- func (d *Database) GetUserProjects(ctx context.Context, subject string) ([]types.Project, error)
- func (d *Database) Heartbeat(ctx context.Context, agentID string) error
- func (d *Database) ListProjectHosts(ctx context.Context, projectId string) (out []types.Host, err error)
- func (d *Database) Migrate(ctx context.Context) error
- func (d *Database) UpsertUser(ctx context.Context, subject string) ([]types.Project, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAgentNotFound = errors.New("agent not found") ErrAgentDeactivated = errors.New("agent deactivated") )
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) AgentShutdown ¶
func (*Database) AgentStartup ¶
func (*Database) AuthenticateAgent ¶
func (*Database) CanAccessProject ¶
CanAccessProject returns true if a user can access a given project ID.
func (*Database) CreateHostGroup ¶
func (*Database) CreateProject ¶
func (d *Database) CreateProject(ctx context.Context, subject, name, description string) (types.Project, error)
CreateProject creates a new project with the given name and description.
func (*Database) GeneratePreSharedKey ¶
func (*Database) GetEventLogsByHost ¶
func (*Database) GetProjectMetrics ¶
func (*Database) GetUserProjects ¶
Click to show internal directories.
Click to hide internal directories.