github.com/qiniu/go-sdk/v7@v7.27.0/pili/hub_model.go (about)

     1  package pili
     2  
     3  // GetHubListResponse 查询直播空间列表返回值
     4  type GetHubListResponse struct {
     5  	// Items 直播空间列表
     6  	Items []GetHubListItem `json:"items"`
     7  }
     8  
     9  // GetHubListItem 查询直播空间列表项
    10  type GetHubListItem struct {
    11  	// Name 直播空间
    12  	Name string `json:"name"`
    13  }
    14  
    15  // GetHubInfoRequest 查询直播空间信息请求参数
    16  type GetHubInfoRequest struct {
    17  	// Hub 直播空间
    18  	Hub string `json:"-" validate:"required"`
    19  }
    20  
    21  // GetHubInfoResponse 查询直播空间信息返回值
    22  type GetHubInfoResponse struct {
    23  	// Name 直播空间名称
    24  	Name string `json:"hubName"`
    25  
    26  	// CreatedAt 创建时间
    27  	// Unix 时间戳
    28  	CreatedAt int64 `json:"createdAt"`
    29  
    30  	// UpdatedAt 更新时间
    31  	// Unix 时间戳
    32  	UpdatedAt int64 `json:"updatedAt"`
    33  
    34  	// Domains 直播空间下的域名列表
    35  	Domains []HubDomain `json:"domains"`
    36  
    37  	// DefaultDomains 直播空间默认域名
    38  	DefaultDomains []DefaultDomain `json:"defaultDomains"`
    39  
    40  	// StorageBucket 存储 bucket
    41  	StorageBucket string `json:"storageBucket"`
    42  
    43  	// LiveDataExpireDays 存储过期时间
    44  	// 单位:天
    45  	LiveDataExpireDays int64 `json:"liveDataExpireDays"`
    46  
    47  	// PublishSecurity 推流鉴权方式
    48  	PublishSecurity string `json:"publishSecurity"`
    49  
    50  	// Nrop 鉴黄配置信息
    51  	Nrop NropArgs `json:"nrop"`
    52  
    53  	// PassiveCodecProfiles 被动转码配置
    54  	// 形式如:720p
    55  	PassiveCodecProfiles []string `json:"passiveCodecProfiles,omitempty"`
    56  
    57  	// Converts 主动转码配置
    58  	// 形式如:720p
    59  	Converts []string `json:"converts"`
    60  
    61  	// HlsPlus 是否开启 hls 低延迟
    62  	HlsPlus bool `json:"hlsPlus"`
    63  
    64  	// VodDomain 点播域名
    65  	VodDomain string `json:"vodDomain"`
    66  
    67  	// AccessLog 直播日志保存信息
    68  	AccessLog AccessLogOptions `json:"accesslog"`
    69  
    70  	// SnapshotInterval 直播封面的截图间隔
    71  	// 单位:秒
    72  	SnapshotInterval int `json:"snapshotInterval"`
    73  }
    74  
    75  // HubDomain 直播空间下的域名简要信息
    76  type HubDomain struct {
    77  	// Type 域名类型
    78  	Type string `json:"type"`
    79  
    80  	// Domain 域名
    81  	Domain string `json:"domain"`
    82  
    83  	// Cname CNAME
    84  	Cname string `json:"cname"`
    85  }
    86  
    87  // DefaultDomain 默认域名
    88  type DefaultDomain struct {
    89  	// Type 域名类型
    90  	Type string `json:"type"`
    91  
    92  	// Domain 域名
    93  	Domain string `json:"domain"`
    94  }
    95  
    96  // NropArgs 鉴黄配置
    97  type NropArgs struct {
    98  	// Enable 是否开启直播空间级别鉴黄功能
    99  	Enable bool `json:"enable"`
   100  
   101  	// Interval 截帧间隔
   102  	// 每个流隔多久进行截帧并鉴黄,单位:秒
   103  	Interval int `json:"interval"`
   104  
   105  	// NotifyURL 回调 URL
   106  	NotifyURL string `json:"notifyURL"`
   107  
   108  	// NotifyRate 通知阈值
   109  	// 鉴黄结果阈值表示AI模型判断当前直播画面有多大的概率涉黄
   110  	// 当鉴黄结果阈值大于或等于通知阈值时,将发送回调信息到回调URL
   111  	NotifyRate float64 `json:"notifyRate"`
   112  }
   113  
   114  // AccessLogOptions 配置
   115  type AccessLogOptions struct {
   116  	// SaveBucket 存储空间
   117  	SaveBucket string `json:"saveBucket"`
   118  
   119  	// ExpireDays 过期天数
   120  	ExpireDays int `json:"expireDays"`
   121  }
   122  
   123  // HubSecurityRequest 修改直播空间推流鉴权配置请求参数
   124  type HubSecurityRequest struct {
   125  	// Hub 直播空间
   126  	Hub string `json:"-" validate:"required"`
   127  
   128  	// PublishSecurity 鉴权方式
   129  	// 可选推流鉴权类型为
   130  	// expiry: 限时鉴权
   131  	// expiry_sk: 限时鉴权SK
   132  	PublishSecurity string `json:"publishSecurity" validate:"required"`
   133  
   134  	// PublishKey 密钥
   135  	PublishKey string `json:"publishKey" validate:"required"`
   136  }
   137  
   138  // HubHlsplusRequest 修改直播空间 hls 低延迟配置请求参数
   139  type HubHlsplusRequest struct {
   140  	// Hub 直播空间
   141  	Hub string `json:"-" validate:"required"`
   142  
   143  	// HlsPlus 是否开启 hls 低延迟
   144  	HlsPlus bool `json:"hlsPlus" validate:"-"`
   145  }
   146  
   147  // HubPersistenceRequest 修改直播空间存储配置请求参数
   148  type HubPersistenceRequest struct {
   149  	// Hub 直播空间
   150  	Hub string `json:"-" validate:"required"`
   151  
   152  	// StorageBucket 存储空间
   153  	StorageBucket string `json:"storageBucket" validate:"required"`
   154  
   155  	// LiveDataExpireDays 存储过期时间
   156  	// 单位:天
   157  	LiveDataExpireDays uint `json:"liveDataExpireDays" validate:"required"`
   158  }
   159  
   160  // HubSnapshotRequest 修改直播空间封面配置请求参数
   161  type HubSnapshotRequest struct {
   162  	// Hub 直播空间
   163  	Hub string `json:"-" validate:"required"`
   164  
   165  	// SnapshotInterval 间隔时间
   166  	// 单位:秒
   167  	SnapshotInterval int `json:"snapshotInterval" validate:"required,gte=0"`
   168  }