push

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Code generated by godddx, DO AVOID EDIT.

Code generated by godddx, DO AVOID EDIT.

Code generated by godddx, DO AVOID EDIT.

Code generated by godddx, DO AVOID EDIT.

Code generated by godddx, DO AVOID EDIT.

Index

Constants

View Source
const (
	StatusPushing = "PUSHING" // 推流中状态
	StatusStopped = "STOPPED" // 停止
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddStreamPushInput

type AddStreamPushInput struct {
	Name           string `json:"name"`             // 推流名称
	App            string `json:"app,required"`     // 应用名
	Stream         string `json:"stream,required"`  // 流 ID
	IsAuthDisabled bool   `json:"is_auth_disabled"` // 是否禁用推流鉴权

}

type Core

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

Core business domain

func NewCore

func NewCore(store Storer, uniqueID uniqueid.Core) Core

NewCore create business domain

func (Core) AddStreamPush

func (c Core) AddStreamPush(ctx context.Context, in *AddStreamPushInput) (*StreamPush, error)

AddStreamPush Insert into database

func (*Core) DelStreamPush

func (c *Core) DelStreamPush(ctx context.Context, id string) (*StreamPush, error)

DelStreamPush Delete object

func (Core) EditStreamPush

func (c Core) EditStreamPush(ctx context.Context, in *EditStreamPushInput, id string) (*StreamPush, error)

EditStreamPush Update object information

func (Core) FindStreamPush

func (c Core) FindStreamPush(ctx context.Context, in *FindStreamPushInput) ([]*StreamPush, int64, error)

FindStreamPush Paginated search

func (Core) GetStreamPush

func (c Core) GetStreamPush(ctx context.Context, id string) (*StreamPush, error)

GetStreamPush Query a single object

func (Core) GetStreamPushByAppStream

func (c Core) GetStreamPushByAppStream(ctx context.Context, app, stream string) (*StreamPush, error)

func (*Core) OnPlay

func (c *Core) OnPlay(ctx context.Context, in OnPlayInput) error

func (*Core) Publish

func (c *Core) Publish(ctx context.Context, in PublishInput) error

Publish 由于 hook 的函数,无需 web.error 封装

func (*Core) UnPublish

func (c *Core) UnPublish(ctx context.Context, app, stream string) error

type EditStreamPushInput

type EditStreamPushInput struct {
	App            string `json:"app"`              // 应用名
	Stream         string `json:"stream"`           // 流 ID
	IsAuthDisabled bool   `json:"is_auth_disabled"` // 是否禁用推流鉴权

}

type FindStreamPushInput

type FindStreamPushInput struct {
	web.PagerFilter
	// App           string    `form:"app"`             // 应用名
	// PushedAt      *orm.Time `form:"pushed_at"`       // 最后一次推流时间
	// StoppedAt     *orm.Time `form:"stopped_at"`      // 最后一次停止时间
	// Stream        string    `form:"stream"`          // 流 ID
	// MediaServerID string    `form:"media_server_id"` // 媒体服务器 ID
	// ServerID      string    `form:"server_id"`       // 服务器 ID
	Status string `form:"status"` // 推流状态(PUSHING)
	Key    string `form:"key"`
}

type FindStreamPushOutputItem

type FindStreamPushOutputItem struct {
	StreamPush
	PushAddrs []string `json:"push_addrs"`
}

type OnPlayInput

type OnPlayInput struct {
	App     string
	Stream  string
	Session string
}

type PublishInput

type PublishInput struct {
	App           string
	Stream        string
	MediaServerID string
	Sign          string
	Secret        string
	Session       string
}

type Storer

type Storer interface {
	StreamPush() StreamPushStorer
}

Storer data persistence

type StreamPush

type StreamPush struct {
	ID             string    `gorm:"primaryKey" json:"id"`
	CreatedAt      orm.Time  `gorm:"column:created_at;notNull;default:CURRENT_TIMESTAMP;comment:创建时间" json:"created_at"`                  // 创建时间
	UpdatedAt      orm.Time  `gorm:"column:updated_at;notNull;default:CURRENT_TIMESTAMP;comment:更新时间" json:"updated_at"`                  // 更新时间
	Name           string    `gorm:"column:name;notNull;default:'';comment:推流名称" json:"name"`                                             // 推流名称
	PushedAt       *orm.Time `gorm:"column:pushed_at;notNull;default:'1970-01-01 00:00:00';comment:最后一次推流时间" json:"pushed_at"`            // 最后一次推流时间
	StoppedAt      *orm.Time `gorm:"column:stopped_at;notNull;default:'1970-01-01 00:00:00';comment:最后一次停止时间" json:"stopped_at"`          // 最后一次停止时间
	App            string    `gorm:"column:app;notNull;default:'';uniqueIndex:idx_stream_pushs_app_stream;comment:应用名" json:"app"`        // 应用名
	Stream         string    `gorm:"column:stream;notNull;default:'';uniqueIndex:idx_stream_pushs_app_stream;comment:流 ID" json:"stream"` // 流 ID
	MediaServerID  string    `gorm:"column:media_server_id;notNull;default:'';comment:媒体服务器 ID" json:"media_server_id"`                   // 媒体服务器 ID
	ServerID       string    `gorm:"column:server_id;notNull;default:'';comment:服务器 ID" json:"server_id"`                                 // 服务器 ID
	Status         string    `gorm:"column:status;notNull;default:'';comment:推流状态(PUSHING)" json:"status"`                                // 推流状态(PUSHING)
	IsAuthDisabled bool      `gorm:"column:is_auth_disabled;notNull;default:false;comment:是否启用推流鉴权" json:"is_auth_disabled"`              // 是否启用推流鉴权

	// 自定义拉流鉴权参数,IsAuthDisabled=false 时生效
	Session string `gorm:"column:session;notNull;default:'';comment:session" json:"-"`
}

StreamPush domain model

func (*StreamPush) TableName

func (*StreamPush) TableName() string

TableName database table name

type StreamPushStorer

StreamPushStorer Instantiation interface

Directories

Path Synopsis
store
pushdb
Code generated by godddx, DO AVOID EDIT.
Code generated by godddx, DO AVOID EDIT.

Jump to

Keyboard shortcuts

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