strategy

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionStrategy

type ActionStrategy interface {
	// IsAppropriate - method will tell the service architect that the strategy is acceptable.
	IsAppropriate(action model.Action) bool
	// Do is a method which contains the useful work of target strategy.
	Do(action model.Action) error
}

type StreamByIDActionStrategy

type StreamByIDActionStrategy struct {
	// contains filtered or unexported fields
}

func NewStreamByIDActionStrategy

func NewStreamByIDActionStrategy(
	ctx context.Context,
	logger logger.Logger,
	videoRepository repository.Video,
	reader reader.FileReader,
	codecInfo detector.Detector,
	communicator proto.Communicator,
) *StreamByIDActionStrategy

func (*StreamByIDActionStrategy) Do

Do - will be streaming a target resource by ID.

func (*StreamByIDActionStrategy) IsAppropriate

func (s *StreamByIDActionStrategy) IsAppropriate(action model.Action) bool

IsAppropriate - method will tell the service architect that the strategy is acceptable.

type StreamByIDWithOffsetActionStrategy

type StreamByIDWithOffsetActionStrategy struct {
	// contains filtered or unexported fields
}

func NewStreamByIDWithOffsetActionStrategy

func NewStreamByIDWithOffsetActionStrategy(
	ctx context.Context,
	logger logger.Logger,
	videoRepository repository.Video,
	reader reader.FileReader,
	codecInfo detector.Detector,
	communicator proto.Communicator,
	chunkSize int,
) *StreamByIDWithOffsetActionStrategy

func (*StreamByIDWithOffsetActionStrategy) Do

Do - will be streaming a target resource by ID from given offset.

func (*StreamByIDWithOffsetActionStrategy) IsAppropriate

func (s *StreamByIDWithOffsetActionStrategy) IsAppropriate(action model.Action) bool

IsAppropriate - method will tell the service architect that the strategy is acceptable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL