Documentation
¶
Index ¶
- func DefaultStateDir() string
- type FileLogger
- func (fl *FileLogger) Close()
- func (fl *FileLogger) LogAPI(method string, args map[string]any, ok bool, callErr error, ...)
- func (fl *FileLogger) LogMeta(projectID int, mrIIDs []int)
- func (fl *FileLogger) LogRunEnd(merged, skipped, pending int, pipelineStatus string, duration time.Duration)
- func (fl *FileLogger) LogSession()
- func (fl *FileLogger) LogStep(mrIID int, step, message string)
- type LoggingClient
- func (c *LoggingClient) GetCurrentUser(ctx context.Context) (*gitlab.User, error)
- func (c *LoggingClient) GetMergeRequest(ctx context.Context, projectID, mrIID int) (*gitlab.MergeRequest, error)
- func (c *LoggingClient) GetMergeRequestPipeline(ctx context.Context, projectID, mrIID int) (*gitlab.Pipeline, string, error)
- func (c *LoggingClient) ListMergeRequestsFull(ctx context.Context, projectPath string) ([]*gitlab.MergeRequest, error)
- func (c *LoggingClient) ListPipelines(ctx context.Context, projectID int, ref, status, sha string) ([]*gitlab.Pipeline, error)
- func (c *LoggingClient) ListProjects(ctx context.Context, search string) ([]*gitlab.Project, error)
- func (c *LoggingClient) MergeMergeRequest(ctx context.Context, projectID, mrIID int, sha string) (string, error)
- func (c *LoggingClient) RebaseMergeRequest(ctx context.Context, projectID, mrIID int) (*gitlab.MergeRequest, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultStateDir ¶
func DefaultStateDir() string
DefaultStateDir returns the platform-appropriate state directory for glmt.
Types ¶
type FileLogger ¶
type FileLogger struct {
// contains filtered or unexported fields
}
FileLogger writes JSON Lines log entries to a file.
func NewFileLogger ¶
func NewFileLogger(dir, token string) (*FileLogger, error)
NewFileLogger creates the state directory and opens a timestamped log file.
func (*FileLogger) LogAPI ¶
func (fl *FileLogger) LogAPI(method string, args map[string]any, ok bool, callErr error, duration time.Duration)
LogAPI writes an API call log entry.
func (*FileLogger) LogMeta ¶
func (fl *FileLogger) LogMeta(projectID int, mrIIDs []int)
LogMeta writes the run metadata header.
func (*FileLogger) LogRunEnd ¶
func (fl *FileLogger) LogRunEnd(merged, skipped, pending int, pipelineStatus string, duration time.Duration)
LogRunEnd writes the run summary.
func (*FileLogger) LogSession ¶
func (fl *FileLogger) LogSession()
LogSession writes a session start entry when the log file is first opened.
func (*FileLogger) LogStep ¶
func (fl *FileLogger) LogStep(mrIID int, step, message string)
LogStep writes a step or decision log entry.
type LoggingClient ¶
type LoggingClient struct {
// contains filtered or unexported fields
}
LoggingClient wraps a gitlab.Client and logs every API call.
func NewLoggingClient ¶
func NewLoggingClient(inner gitlab.Client, logger *FileLogger) *LoggingClient
NewLoggingClient creates a new LoggingClient decorator.
func (*LoggingClient) GetCurrentUser ¶
func (*LoggingClient) GetMergeRequest ¶
func (c *LoggingClient) GetMergeRequest(ctx context.Context, projectID, mrIID int) (*gitlab.MergeRequest, error)
func (*LoggingClient) GetMergeRequestPipeline ¶
func (*LoggingClient) ListMergeRequestsFull ¶
func (c *LoggingClient) ListMergeRequestsFull(ctx context.Context, projectPath string) ([]*gitlab.MergeRequest, error)
func (*LoggingClient) ListPipelines ¶
func (*LoggingClient) ListProjects ¶
func (*LoggingClient) MergeMergeRequest ¶
func (*LoggingClient) RebaseMergeRequest ¶
func (c *LoggingClient) RebaseMergeRequest(ctx context.Context, projectID, mrIID int) (*gitlab.MergeRequest, error)
Click to show internal directories.
Click to hide internal directories.