Documentation
¶
Index ¶
- Constants
- Variables
- func Template() string
- func Verify(t *Meta) error
- func VerifyContainer(c *Container) error
- func VerifyTask(t *Task) error
- type Author
- type Container
- func (*Container) Descriptor() ([]byte, []int)deprecated
- func (x *Container) GetImage() string
- func (x *Container) GetPorts() []string
- func (x *Container) GetResource() *Resource
- func (*Container) ProtoMessage()
- func (x *Container) ProtoReflect() protoreflect.Message
- func (x *Container) Reset()
- func (x *Container) String() string
- type Meta
- type Resource
- type Task
- func (*Task) Descriptor() ([]byte, []int)deprecated
- func (x *Task) GetAttachmentUrl() string
- func (x *Task) GetCategory() string
- func (x *Task) GetDescription() string
- func (x *Task) GetEgress() bool
- func (x *Task) GetFlag() string
- func (x *Task) GetHints() []string
- func (x *Task) GetId() string
- func (x *Task) GetLevel() string
- func (x *Task) GetLevelCode() Task_Level
- func (x *Task) GetName() string
- func (x *Task) GetRefer() string
- func (x *Task) GetTags() []string
- func (x *Task) GetType() string
- func (x *Task) GetTypeCode() Task_Type
- func (*Task) ProtoMessage()
- func (x *Task) ProtoReflect() protoreflect.Message
- func (x *Task) Reset()
- func (x *Task) String() string
- type Task_Level
- type Task_Type
Constants ¶
View Source
const ( // chall_2024_game_web_abc ChallengeTaskIDSpec = `chall_(?<game>[\w]{2,24})_(?<year>[\d]{4})_(?<category>[\w]{2,12})_(?<name>[\w\-]{2,94})$` // skill_web_advanced_jwt_infoleakage SkillTaskIDSpec = `skill_(?<category>[\w]{2,12})_(?<level>[\w]{2,12})_(?<name>[\w\-]{2,94})$` ImageSpec = `[^a-z0-9][a-z0-9_\-]{12,94}[a-z0-9]$` )
Variables ¶
View Source
var ( Task_Type_name = map[int32]string{ 0: "UnknownType", 1: "Con", 2: "File", 3: "Ext", } Task_Type_value = map[string]int32{ "UnknownType": 0, "Con": 1, "File": 2, "Ext": 3, } )
Enum value maps for Task_Type.
View Source
var ( Task_Level_name = map[int32]string{ 0: "UnknownLevel", 1: "Checkin", 2: "Easy", 3: "Medium", 4: "Hard", } Task_Level_value = map[string]int32{ "UnknownLevel": 0, "Checkin": 1, "Easy": 2, "Medium": 3, "Hard": 4, } )
Enum value maps for Task_Level.
View Source
var File_meta_proto protoreflect.FileDescriptor
Functions ¶
func VerifyContainer ¶
func VerifyTask ¶
Types ¶
type Author ¶
type Author struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // 制作者ID (Nickname)
Contact string `protobuf:"bytes,2,opt,name=contact,proto3" json:"contact,omitempty"` // 制作者邮箱 (Email)
// contains filtered or unexported fields
}
题目制作者信息
func (*Author) Descriptor
deprecated
func (*Author) GetContact ¶
func (*Author) ProtoMessage ¶
func (*Author) ProtoMessage()
func (*Author) ProtoReflect ¶
func (x *Author) ProtoReflect() protoreflect.Message
type Container ¶
type Container struct {
Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` // 镜像名称 (命名空间/镜像名称)
Ports []string `protobuf:"bytes,2,rep,name=ports,proto3" json:"ports,omitempty"` // 需要对外暴露的端口, 格式: port/protocol
Resource *Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` // 容器运行资源限制
// contains filtered or unexported fields
}
容器配置
func (*Container) Descriptor
deprecated
func (*Container) GetResource ¶
func (*Container) ProtoMessage ¶
func (*Container) ProtoMessage()
func (*Container) ProtoReflect ¶
func (x *Container) ProtoReflect() protoreflect.Message
type Meta ¶
type Meta struct {
Author *Author `protobuf:"bytes,1,opt,name=author,proto3" json:"author,omitempty"` // 题目制作者信息 (必填)
Task *Task `protobuf:"bytes,2,opt,name=task,proto3" json:"task,omitempty"` // 题目信息 (必填)
Containers []*Container `protobuf:"bytes,3,rep,name=containers,proto3" json:"containers,omitempty"` // 容器配置 (可选, type=con时必填)
// contains filtered or unexported fields
}
题目元信息
func (*Meta) Descriptor
deprecated
func (*Meta) GetContainers ¶
func (*Meta) ProtoMessage ¶
func (*Meta) ProtoMessage()
func (*Meta) ProtoReflect ¶
func (x *Meta) ProtoReflect() protoreflect.Message
type Resource ¶
type Resource struct {
Cpu string `protobuf:"bytes,1,opt,name=cpu,proto3" json:"cpu,omitempty"` // CPU 限制, 如: "250m", "1"
Mem string `protobuf:"bytes,2,opt,name=mem,proto3" json:"mem,omitempty"` // 内存限制, 如: "256Mi", "1Gi"
// contains filtered or unexported fields
}
容器资源配置 (k8s.io.apimachinery.pkg.api.resource.Quantity)
func (*Resource) Descriptor
deprecated
func (*Resource) ProtoMessage ¶
func (*Resource) ProtoMessage()
func (*Resource) ProtoReflect ¶
func (x *Resource) ProtoReflect() protoreflect.Message
type Task ¶
type Task struct {
// 基本信息
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // 题目ID (唯一值), 格式: chall_game_year_type_name 或
// skill_type_level_name
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // 题目显示名称
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // 题目类型: con(容器), file(附件), ext(外部链接)
Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"` // 题目分类: Web, Pwn, Reverse, Misc, Crypto, Forensics,
// Blockchain, Mobile, ICS, IoT
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` // 题目描述
// 难度和Flag
Level string `protobuf:"bytes,6,opt,name=level,proto3" json:"level,omitempty"` // 题目难度: 签到, 简单, 中等, 困难
Flag *string `protobuf:"bytes,7,opt,name=flag,proto3,oneof" json:"flag,omitempty"` // 题目Flag (静态Flag填写具体值, 动态Flag留空)
// 附加信息
AttachmentUrl *string `protobuf:"bytes,8,opt,name=attachment_url,json=attachmentUrl,proto3,oneof" json:"attachment_url,omitempty"` // 题目附件地址
Refer *string `protobuf:"bytes,9,opt,name=refer,proto3,oneof" json:"refer,omitempty"` // 题目来源, 格式: year-game-type-name
Tags []string `protobuf:"bytes,10,rep,name=tags,proto3" json:"tags,omitempty"` // 题目标签 (体现考点)
Hints []string `protobuf:"bytes,12,rep,name=hints,proto3" json:"hints,omitempty"` // 题目提示
// 网络配置
Egress *bool `protobuf:"varint,11,opt,name=egress,proto3,oneof" json:"egress,omitempty"` // 是否允许出网 (true=允许, false=禁止), 默认false
TypeCode Task_Type `protobuf:"varint,91,opt,name=type_code,json=typeCode,proto3,enum=ctfpb.meta.Task_Type" json:"type_code,omitempty"`
LevelCode Task_Level `protobuf:"varint,92,opt,name=level_code,json=levelCode,proto3,enum=ctfpb.meta.Task_Level" json:"level_code,omitempty"`
// contains filtered or unexported fields
}
题目信息
func (*Task) Descriptor
deprecated
func (*Task) GetAttachmentUrl ¶
func (*Task) GetCategory ¶
func (*Task) GetDescription ¶
func (*Task) GetLevelCode ¶
func (x *Task) GetLevelCode() Task_Level
func (*Task) GetTypeCode ¶
func (*Task) ProtoMessage ¶
func (*Task) ProtoMessage()
func (*Task) ProtoReflect ¶
func (x *Task) ProtoReflect() protoreflect.Message
type Task_Level ¶
type Task_Level int32
const ( Task_UnknownLevel Task_Level = 0 Task_Checkin Task_Level = 1 // 签到 (入门) Task_Easy Task_Level = 2 // 简单 (初级) Task_Medium Task_Level = 3 // 中等 (中级) Task_Hard Task_Level = 4 // 困难 (高级) )
func (Task_Level) Descriptor ¶
func (Task_Level) Descriptor() protoreflect.EnumDescriptor
func (Task_Level) Enum ¶
func (x Task_Level) Enum() *Task_Level
func (Task_Level) EnumDescriptor
deprecated
func (Task_Level) EnumDescriptor() ([]byte, []int)
Deprecated: Use Task_Level.Descriptor instead.
func (Task_Level) Number ¶
func (x Task_Level) Number() protoreflect.EnumNumber
func (Task_Level) String ¶
func (x Task_Level) String() string
func (Task_Level) Type ¶
func (Task_Level) Type() protoreflect.EnumType
type Task_Type ¶
type Task_Type int32
枚举类型 (内部使用)
func (Task_Type) Descriptor ¶
func (Task_Type) Descriptor() protoreflect.EnumDescriptor
func (Task_Type) EnumDescriptor
deprecated
func (Task_Type) Number ¶
func (x Task_Type) Number() protoreflect.EnumNumber
func (Task_Type) Type ¶
func (Task_Type) Type() protoreflect.EnumType
Click to show internal directories.
Click to hide internal directories.