Documentation
¶
Index ¶
- Constants
- Variables
- func UseNewSessionBucket(sessionId int) bool
- type Client
- type FilesystemClient
- func (f *FilesystemClient) CleanupRawEvents(ctx context.Context, projectId int) error
- func (f *FilesystemClient) DeleteSessionData(ctx context.Context, projectId int, sessionId int) error
- func (f *FilesystemClient) GetAssetURL(_ context.Context, projectId string, hashVal string) (string, error)
- func (f *FilesystemClient) GetDirectDownloadURL(_ context.Context, projectId int, sessionId int, payloadType PayloadType, ...) (*string, error)
- func (f *FilesystemClient) GetRawData(ctx context.Context, sessionId, projectId int, ...) (map[int]string, error)
- func (f *FilesystemClient) GetSourceMapUploadUrl(_ context.Context, key string) (string, error)
- func (f *FilesystemClient) GetSourcemapFiles(_ context.Context, projectId int, version *string) ([]s3Types.Object, error)
- func (f *FilesystemClient) GetSourcemapVersions(_ context.Context, projectId int) ([]string, error)
- func (f *FilesystemClient) PushCompressedFile(ctx context.Context, sessionId, projectId int, file *os.File, ...) (*int64, error)
- func (f *FilesystemClient) PushFiles(ctx context.Context, sessionId, projectId int, ...) (int64, error)
- func (f *FilesystemClient) PushGitHubFile(ctx context.Context, repoPath string, fileName string, version string, ...) (*int64, error)
- func (f *FilesystemClient) PushRawEvents(ctx context.Context, sessionId, projectId int, ...) error
- func (f *FilesystemClient) PushSourceMapFile(ctx context.Context, projectId int, version *string, fileName string, ...) (*int64, error)
- func (f *FilesystemClient) ReadGitHubFile(ctx context.Context, repoPath string, fileName string, version string) ([]byte, error)
- func (f *FilesystemClient) ReadResources(ctx context.Context, sessionId int, projectId int) ([]interface{}, error)
- func (f *FilesystemClient) ReadSourceMapFileCached(ctx context.Context, projectId int, version *string, fileName string) ([]byte, error)
- func (f *FilesystemClient) ReadTimelineIndicatorEvents(ctx context.Context, sessionId int, projectId int) ([]*model.TimelineIndicatorEvent, error)
- func (f *FilesystemClient) ReadWebSocketEvents(ctx context.Context, sessionId int, projectId int) ([]interface{}, error)
- func (f *FilesystemClient) SetupHTTPSListener(r chi.Router)
- func (f *FilesystemClient) UploadAsset(ctx context.Context, uuid, _ string, reader io.Reader, ...) error
- type PayloadType
- type S3Client
- func (f *S3Client) CleanupRawEvents(ctx context.Context, projectId int) error
- func (s *S3Client) DeleteSessionData(ctx context.Context, projectId int, sessionId int) error
- func (s *S3Client) GetAssetURL(ctx context.Context, projectId string, hashVal string) (string, error)
- func (s *S3Client) GetDirectDownloadURL(_ context.Context, projectId int, sessionId int, payloadType PayloadType, ...) (*string, error)
- func (s *S3Client) GetRawData(ctx context.Context, sessionId, projectId int, ...) (map[int]string, error)
- func (s *S3Client) GetSourceMapUploadUrl(ctx context.Context, key string) (string, error)
- func (s *S3Client) GetSourcemapFiles(ctx context.Context, projectId int, version *string) ([]s3Types.Object, error)
- func (s *S3Client) GetSourcemapVersions(ctx context.Context, projectId int) ([]string, error)
- func (s *S3Client) PushCompressedFile(ctx context.Context, sessionId, projectId int, file *os.File, ...) (*int64, error)
- func (s *S3Client) PushFileToS3(ctx context.Context, sessionId, projectId int, file *os.File, ...) (*int64, error)
- func (s *S3Client) PushFiles(ctx context.Context, sessionId, projectId int, ...) (int64, error)
- func (s *S3Client) PushGitHubFile(ctx context.Context, repoPath string, fileName string, version string, ...) (*int64, error)
- func (s *S3Client) PushGitHubFileReaderToS3(ctx context.Context, repoPath string, fileName string, version string, ...) (*int64, error)
- func (s *S3Client) PushRawEvents(ctx context.Context, sessionId, projectId int, ...) error
- func (s *S3Client) PushSourceMapFile(ctx context.Context, projectId int, version *string, fileName string, ...) (*int64, error)
- func (s *S3Client) PushSourceMapFileReaderToS3(ctx context.Context, projectId int, version *string, fileName string, ...) (*int64, error)
- func (s *S3Client) ReadGitHubFile(ctx context.Context, repoPath string, fileName string, version string) ([]byte, error)
- func (s *S3Client) ReadResources(ctx context.Context, sessionId int, projectId int) ([]interface{}, error)
- func (s *S3Client) ReadSourceMapFileCached(ctx context.Context, projectId int, version *string, fileName string) ([]byte, error)
- func (s *S3Client) ReadTimelineIndicatorEvents(ctx context.Context, sessionId int, projectId int) ([]*model.TimelineIndicatorEvent, error)
- func (s *S3Client) ReadUncompressedResourcesFromS3(ctx context.Context, sessionId int, projectId int) ([]interface{}, error)
- func (s *S3Client) ReadWebSocketEvents(ctx context.Context, sessionId int, projectId int) ([]interface{}, error)
- func (s *S3Client) UploadAsset(ctx context.Context, uuid string, contentType string, reader io.Reader, ...) error
Constants ¶
View Source
const ( MIME_TYPE_JSON = "application/json" CONTENT_ENCODING_BROTLI = "br" RAW_EVENT_RETENTION_DAYS = 1 )
Variables ¶
View Source
var ( S3SessionsPayloadBucketNameNew = env.Config.AwsS3BucketName S3SessionsStagingBucketName = env.Config.AwsS3StagingBucketName S3SourceMapBucketNameNew = env.Config.AwsS3SourceMapBucketName S3ResourcesBucketName = env.Config.AwsS3ResourcesBucketName S3GithubBucketName = env.Config.AwsS3GithubBucketName CloudfrontDomain = env.Config.AwsCloudfrontDomain CloudfrontPublicKeyID = env.Config.AwsCloudfrontPublicKeyID CloudfrontPrivateKey = env.Config.AwsCloudfrontPrivateKey )
View Source
var StoredPayloadTypes = map[payload.FileType]PayloadType{ payload.EventsCompressed: SessionContentsCompressed, payload.ResourcesCompressed: NetworkResourcesCompressed, payload.TimelineIndicatorEvents: TimelineIndicatorEvents, payload.WebSocketEventsCompressed: WebSocketEventsCompressed, }
StoredPayloadTypes configures what payloads are uploaded with this config.
Functions ¶
func UseNewSessionBucket ¶
Types ¶
type Client ¶
type Client interface { GetAssetURL(ctx context.Context, projectId string, hashVal string) (string, error) GetDirectDownloadURL(ctx context.Context, projectId int, sessionId int, payloadType PayloadType, chunkId *int) (*string, error) GetRawData(ctx context.Context, sessionId, projectId int, payloadType model.RawPayloadType) (map[int]string, error) GetSourceMapUploadUrl(ctx context.Context, key string) (string, error) GetSourcemapFiles(ctx context.Context, projectId int, version *string) ([]s3Types.Object, error) GetSourcemapVersions(ctx context.Context, projectId int) ([]string, error) PushCompressedFile(ctx context.Context, sessionId, projectId int, file *os.File, payloadType PayloadType, retentionPeriod privateModel.RetentionPeriod) (*int64, error) PushFiles(ctx context.Context, sessionId, projectId int, payloadManager *payload.PayloadManager, retentionPeriod privateModel.RetentionPeriod) (int64, error) PushRawEvents(ctx context.Context, sessionId, projectId int, payloadType model.RawPayloadType, events []redis.Z) error PushSourceMapFile(ctx context.Context, projectId int, version *string, fileName string, fileBytes []byte) (*int64, error) ReadResources(ctx context.Context, sessionId int, projectId int) ([]interface{}, error) ReadWebSocketEvents(ctx context.Context, sessionId int, projectId int) ([]interface{}, error) ReadSourceMapFileCached(ctx context.Context, projectId int, version *string, fileName string) ([]byte, error) ReadTimelineIndicatorEvents(ctx context.Context, sessionId int, projectId int) ([]*model.TimelineIndicatorEvent, error) UploadAsset(ctx context.Context, uuid string, contentType string, reader io.Reader, retentionPeriod privateModel.RetentionPeriod) error ReadGitHubFile(ctx context.Context, repoPath string, fileName string, version string) ([]byte, error) PushGitHubFile(ctx context.Context, repoPath string, fileName string, version string, fileBytes []byte) (*int64, error) DeleteSessionData(ctx context.Context, projectId int, sessionId int) error CleanupRawEvents(ctx context.Context, projectId int) error // contains filtered or unexported methods }
type FilesystemClient ¶
type FilesystemClient struct {
// contains filtered or unexported fields
}
func NewFSClient ¶
func NewFSClient(_ context.Context, origin, fsRoot string) (*FilesystemClient, error)
func (*FilesystemClient) CleanupRawEvents ¶
func (f *FilesystemClient) CleanupRawEvents(ctx context.Context, projectId int) error
func (*FilesystemClient) DeleteSessionData ¶
func (*FilesystemClient) GetAssetURL ¶
func (*FilesystemClient) GetDirectDownloadURL ¶
func (f *FilesystemClient) GetDirectDownloadURL(_ context.Context, projectId int, sessionId int, payloadType PayloadType, chunkId *int) (*string, error)
func (*FilesystemClient) GetRawData ¶
func (f *FilesystemClient) GetRawData(ctx context.Context, sessionId, projectId int, payloadType model.RawPayloadType) (map[int]string, error)
func (*FilesystemClient) GetSourceMapUploadUrl ¶
func (*FilesystemClient) GetSourcemapFiles ¶
func (*FilesystemClient) GetSourcemapVersions ¶
func (*FilesystemClient) PushCompressedFile ¶
func (f *FilesystemClient) PushCompressedFile(ctx context.Context, sessionId, projectId int, file *os.File, payloadType PayloadType, retentionPeriod privateModel.RetentionPeriod) (*int64, error)
func (*FilesystemClient) PushFiles ¶
func (f *FilesystemClient) PushFiles(ctx context.Context, sessionId, projectId int, payloadManager *payload.PayloadManager, retentionPeriod privateModel.RetentionPeriod) (int64, error)
func (*FilesystemClient) PushGitHubFile ¶
func (*FilesystemClient) PushRawEvents ¶
func (f *FilesystemClient) PushRawEvents(ctx context.Context, sessionId, projectId int, payloadType model.RawPayloadType, events []redis.Z) error
func (*FilesystemClient) PushSourceMapFile ¶
func (*FilesystemClient) ReadGitHubFile ¶
func (*FilesystemClient) ReadResources ¶
func (*FilesystemClient) ReadSourceMapFileCached ¶
func (*FilesystemClient) ReadTimelineIndicatorEvents ¶
func (f *FilesystemClient) ReadTimelineIndicatorEvents(ctx context.Context, sessionId int, projectId int) ([]*model.TimelineIndicatorEvent, error)
func (*FilesystemClient) ReadWebSocketEvents ¶
func (*FilesystemClient) SetupHTTPSListener ¶
func (f *FilesystemClient) SetupHTTPSListener(r chi.Router)
func (*FilesystemClient) UploadAsset ¶
func (f *FilesystemClient) UploadAsset(ctx context.Context, uuid, _ string, reader io.Reader, retentionPeriod privateModel.RetentionPeriod) error
type PayloadType ¶
type PayloadType string
const ( NetworkResources PayloadType = "network-resources" SessionContentsCompressed PayloadType = "session-contents-compressed" NetworkResourcesCompressed PayloadType = "network-resources-compressed" TimelineIndicatorEvents PayloadType = "timeline-indicator-events" WebSocketEventsCompressed PayloadType = "web-socket-events-compressed" )
func GetChunkedPayloadType ¶
func GetChunkedPayloadType(offset int) PayloadType
type S3Client ¶
type S3Client struct { S3ClientEast2 *s3.Client S3PresignClient *s3.PresignClient URLSigner *sign.URLSigner Redis *hredis.Client }
func (*S3Client) CleanupRawEvents ¶
func (*S3Client) DeleteSessionData ¶
func (*S3Client) GetAssetURL ¶
func (*S3Client) GetDirectDownloadURL ¶
func (*S3Client) GetRawData ¶
func (*S3Client) GetSourceMapUploadUrl ¶
func (*S3Client) GetSourcemapFiles ¶
func (*S3Client) GetSourcemapVersions ¶
func (*S3Client) PushCompressedFile ¶
func (s *S3Client) PushCompressedFile(ctx context.Context, sessionId, projectId int, file *os.File, payloadType PayloadType, retentionPeriod privateModel.RetentionPeriod) (*int64, error)
PushCompressedFile pushes a compressed file to S3, adding the relevant metadata
func (*S3Client) PushFileToS3 ¶
func (*S3Client) PushFiles ¶
func (s *S3Client) PushFiles(ctx context.Context, sessionId, projectId int, payloadManager *payload.PayloadManager, retentionPeriod privateModel.RetentionPeriod) (int64, error)
func (*S3Client) PushGitHubFile ¶
func (*S3Client) PushGitHubFileReaderToS3 ¶
func (*S3Client) PushRawEvents ¶
func (*S3Client) PushSourceMapFile ¶
func (*S3Client) PushSourceMapFileReaderToS3 ¶
func (*S3Client) ReadGitHubFile ¶
func (*S3Client) ReadResources ¶
func (*S3Client) ReadSourceMapFileCached ¶
func (*S3Client) ReadTimelineIndicatorEvents ¶
func (*S3Client) ReadUncompressedResourcesFromS3 ¶
func (s *S3Client) ReadUncompressedResourcesFromS3(ctx context.Context, sessionId int, projectId int) ([]interface{}, error)
ReadUncompressedResourcesFromS3 is deprecated. Serves legacy uncompressed network data from S3.
func (*S3Client) ReadWebSocketEvents ¶
func (*S3Client) UploadAsset ¶
func (s *S3Client) UploadAsset(ctx context.Context, uuid string, contentType string, reader io.Reader, retentionPeriod privateModel.RetentionPeriod) error
Click to show internal directories.
Click to hide internal directories.