Documentation ¶
Index ¶
- Constants
- type Error
- type Metadata
- type MetadataImage
- type MetadataVideo
- type MetadataVideoDimension
- type Stream
- type StreamChunk
- type StreamChunks
- func (c *StreamChunks) Append(req *grpc_runner_v1.StreamRequest) (err error)
- func (c *StreamChunks) Chunks() (streamChunks []StreamChunk)
- func (c *StreamChunks) Copy() (streamChunks *StreamChunks)
- func (c *StreamChunks) Len() int
- func (c *StreamChunks) Less(i, j int) bool
- func (c *StreamChunks) Merge()
- func (c *StreamChunks) Missing() (streamChunks []StreamChunk)
- func (c *StreamChunks) Reset()
- func (c *StreamChunks) Swap(i, j int)
- type Transfer
Constants ¶
const ( // ErrUnallocatedStream is throw when an action is attempted to be performed on a // nil stream. ErrUnallocatedStream = Error("unallocated stream") // ErrInactive is thrown when a transfer is expected to be active, but it's inactive. ErrInactive = Error("inactive transfer") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error string
Error is a custom error implementation for the `transfer` package in-order to have them stored as constants.
func ErrHashVerification ¶
ErrHashVerification is thrown during the verification process, when the metadata hash does not match the stream hash
func ErrRequestAdler32Checksum ¶
func ErrRequestAdler32Checksum(request *grpc_runner_v1.StreamRequest, outcome uint32) Error
ErrRequestAdler32Checksum is thrown during the stream upload process, when the request fnv32a does not match the []byte request content.
func ErrSizeVerification ¶
ErrSizeVerification is thrown during the verification process, when the metadata size does not match the stream size
type Metadata ¶
type Metadata struct { Video *MetadataVideo `json:"video"` Image *MetadataImage `json:"image"` }
type MetadataImage ¶
type MetadataVideo ¶
type MetadataVideo struct { Dimension *MetadataVideoDimension `json:"dimension"` SHA256 string `json:"sha256"` CRC32 string `json:"crc32"` Duration float64 `json:"duration"` Size int64 `json:"size"` }
type MetadataVideoDimension ¶
type Stream ¶
type Stream interface { io.Reader io.Seeker io.WriterAt io.Closer Stat() (fs.FileInfo, error) Name() string }
Stream consists of all the methods required for a transfer we're basically interfacing out the *os.File so other methods could make use of this method (say in the future we decide to store in an S3 bucket).
func NewNoopStream ¶
func NewNoopStream() Stream
type StreamChunk ¶
type StreamChunks ¶
type StreamChunks struct {
// contains filtered or unexported fields
}
func NewStreamChunks ¶
func NewStreamChunks(chunks ...StreamChunk) *StreamChunks
func (*StreamChunks) Append ¶
func (c *StreamChunks) Append( req *grpc_runner_v1.StreamRequest, ) (err error)
func (*StreamChunks) Chunks ¶
func (c *StreamChunks) Chunks() (streamChunks []StreamChunk)
func (*StreamChunks) Copy ¶
func (c *StreamChunks) Copy() (streamChunks *StreamChunks)
func (*StreamChunks) Len ¶
func (c *StreamChunks) Len() int
func (*StreamChunks) Less ¶
func (c *StreamChunks) Less(i, j int) bool
func (*StreamChunks) Merge ¶
func (c *StreamChunks) Merge()
func (*StreamChunks) Missing ¶
func (c *StreamChunks) Missing() (streamChunks []StreamChunk)
func (*StreamChunks) Reset ¶
func (c *StreamChunks) Reset()
func (*StreamChunks) Swap ¶
func (c *StreamChunks) Swap(i, j int)
type Transfer ¶
type Transfer interface { Active() bool Setup(anime domain.AnimeBase, imageFs, videoFs Stream) WriterAt(typ grpc_runner_v1.StreamType) io.WriterAt Reader(typ grpc_runner_v1.StreamType) io.Reader Corrupt(request *grpc_runner_v1.StreamRequest) CorruptParts() int IsCurrent(anime domain.AnimeBase) bool SetMetadata(metadata Metadata) Metadata() Metadata Anime() domain.AnimeBase Verify() error Close() error }