Skip to content

Commit

Permalink
feat: video cli tool
Browse files Browse the repository at this point in the history
Adds a video cli tool which allows for configuration of the video api
from a simple to use CLI interface.
  • Loading branch information
TroyKomodo committed Dec 25, 2023
1 parent 4579bc6 commit 06739c1
Show file tree
Hide file tree
Showing 91 changed files with 5,495 additions and 253 deletions.
165 changes: 157 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"video/player",
"video/player_types",
"video/common",
"video/cli",
"binary-helper",
"common",
"proto",
Expand Down
2 changes: 1 addition & 1 deletion proto/scuffle/video/v1/types/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ message Event {
// S3 Bucket event.
message S3Bucket {
// The ULID of the S3 Buckets that this event is for.
scuffle.types.Ulid s3_buckets_id = 1;
scuffle.types.Ulid s3_bucket_id = 1;

// If the S3 Buckets was created.
message Created {}
Expand Down
2 changes: 2 additions & 0 deletions video/api/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pub(crate) mod s3_bucket;
pub(crate) mod transcoding_config;
pub(crate) mod utils;

pub use utils::{ApiRequest, RequiredScope, ResourcePermission};

fn global_middleware<G: ApiGlobal>(
global: &Arc<G>,
) -> impl Fn(tonic::Request<()>) -> tonic::Result<tonic::Request<()>> + Clone {
Expand Down
2 changes: 1 addition & 1 deletion video/api/src/api/s3_bucket/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl ApiRequest<S3BucketCreateResponse> for tonic::Request<S3BucketCreateRequest
access_token.organization_id.0,
Target::S3Bucket,
event::Event::S3Bucket(event::S3Bucket {
s3_buckets_id: Some(result.id.0.into()),
s3_bucket_id: Some(result.id.0.into()),
event: Some(event::s3_bucket::Event::Created(event::s3_bucket::Created {})),
}),
)
Expand Down
2 changes: 1 addition & 1 deletion video/api/src/api/s3_bucket/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl ApiRequest<S3BucketDeleteResponse> for tonic::Request<S3BucketDeleteRequest
access_token.organization_id.0,
Target::S3Bucket,
event::Event::S3Bucket(event::S3Bucket {
s3_buckets_id: Some(id.0.into()),
s3_bucket_id: Some(id.0.into()),
event: Some(event::s3_bucket::Event::Deleted(event::s3_bucket::Deleted {})),
}),
)
Expand Down
2 changes: 1 addition & 1 deletion video/api/src/api/s3_bucket/modify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl ApiRequest<S3BucketModifyResponse> for tonic::Request<S3BucketModifyRequest
access_token.organization_id.0,
Target::S3Bucket,
event::Event::S3Bucket(event::S3Bucket {
s3_buckets_id: Some(result.id.0.into()),
s3_bucket_id: Some(result.id.0.into()),
event: Some(event::s3_bucket::Event::Modified(event::s3_bucket::Modified {})),
}),
)
Expand Down
2 changes: 1 addition & 1 deletion video/api/src/api/s3_bucket/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl_request_scopes!(

impl_tag_req!(S3BucketTagRequest, S3BucketTagResponse, Target::S3Bucket, [id] {
event::Event::S3Bucket(event::S3Bucket {
s3_buckets_id: Some(id.into()),
s3_bucket_id: Some(id.into()),
event: Some(event::s3_bucket::Event::Modified(event::s3_bucket::Modified {})),
})
});
2 changes: 1 addition & 1 deletion video/api/src/api/s3_bucket/untag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl_request_scopes!(

impl_untag_req!(S3BucketUntagRequest, S3BucketUntagResponse, Target::S3Bucket, [id] {
event::Event::S3Bucket(event::S3Bucket {
s3_buckets_id: Some(id.into()),
s3_bucket_id: Some(id.into()),
event: Some(event::s3_bucket::Event::Modified(event::s3_bucket::Modified {})),
})
});
Loading

0 comments on commit 06739c1

Please sign in to comment.