anchor
dict
positive
dict
negative
dict
{ "audio": "", "image": "", "text": "func (m *MockCollector) Count() int {\n\tret := m.ctrl.Call(m, \"Count\")\n\tret0,", "video": "" }
{ "audio": "", "image": "", "text": " _ := ret[0].(int)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetAckFrame\", arg0)\n\tret0, _ := ret[0].(*wire.AckFrame)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (mr *MockCollectorMockRecorder) Count() *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock,", "video": "" }
{ "audio": "", "image": "", "text": " \"Count\", reflect.TypeOf((*MockCollector)(nil).Count))\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"ChangeConnectionID\", reflect.TypeOf((*MockCryptoSetup)(nil).ChangeConnectionID), arg0)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *MockCollector) GetAllRecords() map[string]*collector.FlowRecord {\n\tret := m.ctrl.Call(m, \"GetAllRecords\")\n\tret0, _ :=", "video": "" }
{ "audio": "", "image": "", "text": " ret[0].(map[string]*collector.FlowRecord)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetAckFrame\", arg0)\n\tret0, _ := ret[0].(*wire.AckFrame)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *MockCollector) GetAllDataPathPacketRecords() []*collector.PacketReport", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tret := m.ctrl.Call(m, \"GetAllDataPathPacketRecords\")\n\tret0, _ := ret[0].([]*collector.PacketReport)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tah.timer = time.AfterFunc(timeout, func() {\n\t\tm.ackLock.Lock()\n\t\tdelete(m.ackHandlers, seqNo)\n\t\tm.ackLock.Unlock()\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (mr *MockCollectorMockRecorder) CollectUserEvent(record interface{}) *gomock.Call {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"CollectUserEvent\", reflect.TypeOf((*MockCollector)(nil).CollectUserEvent), record)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\treturn nil, ErrInvalidParams()\n\t}\n\n\tmr.m.RLock()\n\tmd, ok := mr.r[r.Method]\n\tmr.m.RUnlock()\n\tif !ok {\n\t\treturn nil, ErrMethodNotFound()\n\t}\n\n\treturn md.Handler, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewPortSpec(min, max uint16, value interface{}) (*PortSpec, error) {\n\n\tif min > max {\n\t\treturn nil, errors.New(\"Min port greater than", "video": "" }
{ "audio": "", "image": "", "text": " max\")\n\t}\n\n\treturn &PortSpec{\n\t\tMin: min,\n\t\tMax: max,\n\t\tvalue: value,\n\t}, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\t\tmin = mid + 1\n\t\t} else {\n\t\t\tmax = mid\n\t\t}\n\t}\n\tif max < 0 || s.Set[min].Less(q) {\n\t\treturn len(s.Set), false // q is the new largest value\n\t}\n\treturn min, s.Set[min].Contains(q)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewPortSpecFromString(ports string, value interface{}) (*PortSpec, error) {\n\n\tvar min, max int\n\tvar err error\n\tif strings.Contains(ports, \":\") {\n\t\tportMinMax := strings.SplitN(ports, \":\", 2)\n\t\tif len(portMinMax) != 2 {\n\t\t\treturn nil, errors.New(\"Inva...
{ "audio": "", "image": "", "text": " != nil || max >= 65536 {\n\t\t\treturn nil, errors.New(\"Max is not a valid port\")\n\t\t}\n\t} else {\n\t\tmin, err = strconv.Atoi(ports)\n\t\tif err != nil || min >= 65536 || min < 0 {\n\t\t\treturn nil, errors.New(\"Port is larger than 2^16 or invalid port\")\n\t\t}\n\t\tm...
{ "audio": "", "image": "", "text": "\t\t\tmin = mid + 1\n\t\t} else {\n\t\t\tmax = mid\n\t\t}\n\t}\n\tif max < 0 || s.Set[min].Less(q) {\n\t\treturn len(s.Set), false // q is the new largest value\n\t}\n\treturn min, s.Set[min].Contains(q)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (s *PortSpec) SinglePort() (uint16, error) {\n\tif s.IsMultiPort()", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\treturn 0, errors.New(\"Not a single port specification\")\n\t}\n\n\treturn s.Min, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tuser.Banned = false\n\treturn s.ExecuteInTransaction(func() error {\n\t\treturn s.Repositories().Users().Save(ctx, &user)\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (s *PortSpec) String() string {\n\tif s.IsMultiPort() {\n\t\treturn strconv.Itoa(int(s.Min)) + \":\" +", "video": "" }
{ "audio": "", "image": "", "text": " strconv.Itoa(int(s.Max))\n\t}\n\n\treturn strconv.Itoa(int(s.Min))\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\treStr := `([` + regexp.QuoteMeta(k) + `])`\n\t\tre := regexp.MustCompile(reStr)\n\t\tescArg = re.ReplaceAllStringFunc(escArg, func(s string) string {\n\t\t\tescaped := escapeMap[s] + s\n\t\t\treturn escaped\n\t\t})\n\t}\n\treturn escArg\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (s *PortSpec) Overlaps(p *PortSpec) bool {\n\ta := p\n\tb := s\n\tif a.Min > b.Min {\n\t\ta = s\n\t\tb = p\n\t}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tif a.Max >= b.Min {\n\t\treturn true\n\t}\n\treturn false\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t}\n\n\t\t// find a better one\n\t\tif limit < min {\n\t\t\tmin = limit\n\t\t}\n\t}\n\n\tif min > 0 {\n\t\ts.MaxHeaderBytes = int(min)\n\t}\n\treturn s\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (s *PortSpec) IsIncluded(port int) bool {\n\tp := uint16(port)\n\tif s.Min <= p && p <=", "video": "" }
{ "audio": "", "image": "", "text": " s.Max {\n\t\treturn true\n\t}\n\treturn false\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\tMap(int64To16).\n\t\tWithShrinker(Int16Shrinker).\n\t\tSuchThat(func(v int16) bool {\n\t\t\treturn v >= min && v <= max\n\t\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) VerifyIPChecksum() bool {\n\n\tsum := p.computeIPChecksum()\n", "video": "" }
{ "audio": "", "image": "", "text": "\n\treturn sum == p.ipHdr.ipChecksum\n}", "video": "" }
{ "audio": "", "image": "", "text": "\treturn func(p *ProgressBar) {\n\t\tp.config.width = s\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) UpdateIPChecksum() {\n\n\tp.ipHdr.ipChecksum = p.computeIPChecksum()\n\n", "video": "" }
{ "audio": "", "image": "", "text": "\tbinary.BigEndian.PutUint16(p.ipHdr.Buffer[ipv4ChecksumPos:ipv4ChecksumPos+2], p.ipHdr.ipChecksum)\n}", "video": "" }
{ "audio": "", "image": "", "text": " p.ipHdr.Buffer[p.ipHdr.ipHeaderLen+UDPDataPos:]\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) VerifyTCPChecksum() bool {\n\n\tsum := p.computeTCPChecksum()\n", "video": "" }
{ "audio": "", "image": "", "text": "\n\treturn sum == p.tcpHdr.tcpChecksum\n}", "video": "" }
{ "audio": "", "image": "", "text": "\treturn func(p *ProgressBar) {\n\t\tp.config.width = s\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) UpdateTCPChecksum() {\n\tbuffer := p.ipHdr.Buffer[p.ipHdr.ipHeaderLen:]\n\tp.tcpHdr.tcpChecksum", "video": "" }
{ "audio": "", "image": "", "text": " = p.computeTCPChecksum()\n\tbinary.BigEndian.PutUint16(buffer[tcpChecksumPos:tcpChecksumPos+2], p.tcpHdr.tcpChecksum)\n}", "video": "" }
{ "audio": "", "image": "", "text": " p.ipHdr.Buffer[p.ipHdr.ipHeaderLen+UDPDataPos:]\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) PacketToStringTCP() string {\n\n\tvar buf bytes.Buffer\n\tbuf.WriteString(\"(error)\")\n\n\theader, err := ipv4.ParseHeader(p.ipHdr.Buffer)\n\n\tif err == nil {\n\t\tbuf.Reset()\n\t\tbuf.WriteString(header.String())\n\t\tbuf.WriteString(\" srcport=\")\n\t\tbuf...
{ "audio": "", "image": "", "text": "\t\tbuf.WriteString(strconv.Itoa(int(p.DestPort())))\n\t\tbuf.WriteString(\" tcpcksum=\")\n\t\tbuf.WriteString(fmt.Sprintf(\"0x%0x\", p.tcpHdr.tcpChecksum))\n\t\tbuf.WriteString(\" data\")\n\t\tbuf.WriteString(hex.EncodeToString(p.GetTCPBytes()))\n\t}\n\treturn buf.String()\n}...
{ "audio": "", "image": "", "text": "\t\tif idx != len(arr)-1 {\n\t\t\tbuf.WriteString(\", \")\n\t\t}\n\t}\n\n\tbuf.WriteString(\"], Hex: [\")\n\n\tfor idx, b := range arr {\n\t\tbuf.WriteString(fmt.Sprintf(\"%X\", b))\n\t\tif idx != len(arr)-1 {\n\t\t\tbuf.WriteString(\" \")\n\t\t}\n\t}\n\n\tbuf.WriteString(\"],...
{ "audio": "", "image": "", "text": "func (p *Packet) computeIPChecksum() uint16 {\n\n\t// IP packet checksum is computed with the checksum value set to zero\n\tp.ipHdr.Buffer[ipv4ChecksumPos] = 0\n\tp.ipHdr.Buffer[ipv4ChecksumPos+1] = 0\n\n\t// Compute checksum, over IP header only\n\tsum := checksum(p.ipHdr.Buf...
{ "audio": "", "image": "", "text": " or not, as this function doesn't change it)\n\tbinary.BigEndian.PutUint16(p.ipHdr.Buffer[ipv4ChecksumPos:ipv4ChecksumPos+2], p.ipHdr.ipChecksum)\n\n\treturn sum\n}", "video": "" }
{ "audio": "", "image": "", "text": " p.ipHdr.Buffer[p.ipHdr.ipHeaderLen+UDPDataPos:]\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) computeTCPChecksum() uint16 {\n\tvar buf [2]byte\n\tbuffer := p.ipHdr.Buffer[p.ipHdr.ipHeaderLen:]\n\ttcpBufSize := uint16(len(buffer) + len(p.tcpHdr.tcpData) + len(p.tcpHdr.tcpOptions))\n\n\toldCsumLow := buffer[tcpChecksumPos]\n\toldCsumHigh := buffer[tcpChe...
{ "audio": "", "image": "", "text": "\tcsum = partialChecksum(csum, buf[:])\n\n\tcsum = partialChecksum(csum, buffer)\n\tcsum = partialChecksum(csum, p.tcpHdr.tcpOptions)\n\tcsum = partialChecksum(csum, p.tcpHdr.tcpData)\n\n\tcsum16 := finalizeChecksum(csum)\n\n\t// restore the checksum\n\tbuffer[tcpChecksumPos] ...
{ "audio": "", "image": "", "text": " p.ipHdr.Buffer[p.ipHdr.ipHeaderLen+UDPDataPos:]\n}", "video": "" }
{ "audio": "", "image": "", "text": "func incCsum16(start, old, new uint16) uint16 {\n\n\tstart = start ^ 0xffff\n\told = old ^ 0xffff\n\n\tcsum := uint32(start) + uint32(old) + uint32(new)\n\tfor (csum >> 16) > 0 {\n\t\tcsum = (csum &", "video": "" }
{ "audio": "", "image": "", "text": " 0xffff) + ((csum >> 16) & 0xffff)\n\t}\n\tcsum = csum ^ 0xffff\n\treturn uint16(csum)\n}", "video": "" }
{ "audio": "", "image": "", "text": " (X >> 8)) & 0x0000ffff0000ffff\n\tX = (X | (X >> 16)) & 0x00000000ffffffff\n\treturn uint32(X)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func checksumDelta(init uint32, buf []byte) uint32 {\n\n\tsum := init\n\n\tfor ; len(buf) >= 2; buf = buf[2:] {\n\t\tsum += uint32(buf[0])<<8", "video": "" }
{ "audio": "", "image": "", "text": " | uint32(buf[1])\n\t}\n\n\tif len(buf) > 0 {\n\t\tsum += uint32(buf[0]) << 8\n\t}\n\n\treturn sum\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tcursor.init = func(buf *pktque.Buf, videoidx int) pktque.BufPos {\n\t\treturn buf.Head\n\t}\n\treturn cursor\n}", "video": "" }
{ "audio": "", "image": "", "text": "func checksum(buf []byte) uint16 {\n\tsum32 := checksumDelta(0, buf)\n\tsum16 :=", "video": "" }
{ "audio": "", "image": "", "text": " csumConvert32To16bit(sum32)\n\n\tcsum := ^sum16\n\treturn csum\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\treturn 0, err\n\t}\n\n\tlength := uint16(meterConfigLen + buf.Len())\n\treturn encoding.WriteTo(w, length, m.Flags, m.Meter, buf.Bytes())\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) UpdateUDPChecksum() {\n\n\t// checksum set to 0, ignored by the stack\n\tbuffer := p.ipHdr.Buffer[p.ipHdr.ipHeaderLen:]\n\tignoreCheckSum := []byte{0, 0}\n\tp.udpHdr.udpChecksum = binary.BigEndian.Uint16(ignoreCheckSum[:])\n", "video": "" }
{ "audio": "", "image": "", "text": "\n\tcurLen := uint16(len(buffer))\n\tudpDataLen := curLen - p.GetUDPDataStartBytes()\n\n\t// update checksum.\n\tbinary.BigEndian.PutUint16(buffer[udpChecksumPos:udpChecksumPos+2], p.udpHdr.udpChecksum)\n\t// update length.\n\tbinary.BigEndian.PutUint16(buffer[udpLengthPos:udp...
{ "audio": "", "image": "", "text": " p.ipHdr.Buffer[p.ipHdr.ipHeaderLen+UDPDataPos:]\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) ReadUDPToken() []byte {\n\tbuffer := p.ipHdr.Buffer[p.ipHdr.ipHeaderLen:]\n\t// 8 byte udp header, 20 byte udp marker\n", "video": "" }
{ "audio": "", "image": "", "text": "\tif len(buffer) <= udpJwtTokenOffset {\n\t\treturn []byte{}\n\t}\n\treturn buffer[udpJwtTokenOffset:]\n}", "video": "" }
{ "audio": "", "image": "", "text": " p.ipHdr.Buffer[p.ipHdr.ipHeaderLen+UDPDataPos:]\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) UDPTokenAttach(udpdata []byte, udptoken []byte) {\n\n\tudpData := []byte{}\n\tudpData = append(udpData, udpdata...)\n\tudpData = append(udpData, udptoken...)\n\n\tpacketLenIncrease := uint16(len(udpdata) + len(udptoken))\n\n\t// IP Header", "video": "" }
{ "audio": "", "image": "", "text": " Processing\n\tp.FixupIPHdrOnDataModify(p.ipHdr.ipTotalLength, p.ipHdr.ipTotalLength+packetLenIncrease)\n\n\t// Attach Data @ the end of current buffer\n\tp.ipHdr.Buffer = append(p.ipHdr.Buffer, udpData...)\n\n\tp.UpdateUDPChecksum()\n}", "video": "" }
{ "audio": "", "image": "", "text": " := other.Port; len(port) > 0 {\n\t\tcfg.Port = \":\" + port\n\t}\n\n\tif ip := other.IP; len(ip) > 0 {\n\t\tcfg.IP = ip\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) UDPDataAttach(header, udpdata []byte) {\n\n\t// Attach Data @ the end of current buffer\n\tp.ipHdr.Buffer = append(p.ipHdr.Buffer, header...)\n\tp.ipHdr.Buffer = append(p.ipHdr.Buffer, udpdata...)\n\t// IP", "video": "" }
{ "audio": "", "image": "", "text": " Header Processing\n\tp.FixupIPHdrOnDataModify(p.ipHdr.ipTotalLength, uint16(len(p.ipHdr.Buffer)))\n\tp.UpdateUDPChecksum()\n}", "video": "" }
{ "audio": "", "image": "", "text": " p.ipHdr.Buffer[p.ipHdr.ipHeaderLen+UDPDataPos:]\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) CreateReverseFlowPacket(destIP net.IP, destPort uint16) {\n\tbuffer := p.ipHdr.Buffer[p.ipHdr.ipHeaderLen:]\n\n\tsrcAddr := binary.BigEndian.Uint32(destIP.To4())\n\tdestAddr := binary.BigEndian.Uint32(p.ipHdr.Buffer[ipv4DestAddrPos : ipv4DestAddrPos+4])\n\n\t/...
{ "audio": "", "image": "", "text": " Ignore the rest. No need for packet\n\tp.ipHdr.Buffer = p.ipHdr.Buffer[:p.ipHdr.ipHeaderLen+UDPDataPos]\n\n\t// change the fields\n\tp.ipHdr.sourceAddress = net.IP(p.ipHdr.Buffer[ipv4SourceAddrPos : ipv4SourceAddrPos+4])\n\tp.ipHdr.destinationAddress = destIP\n\n\tp.udpHdr.so...
{ "audio": "", "image": "", "text": " p.ipHdr.Buffer[p.ipHdr.ipHeaderLen+UDPDataPos:]\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) GetUDPType() byte {\n\t// Every UDP control packet has a 20 byte packet signature. The\n\t// first 2 bytes represent the following control information.\n\t// Byte 0 : Bits 0,1 are reserved fields.\n\t// Bits 2,3,4 represent version information.\n\t// ...
{ "audio": "", "image": "", "text": " Bit 7 represents encryption. (currently unused).\n\t// Byte 1: reserved for future use.\n\t// Bytes [2:20]: Packet signature.\n\treturn GetUDPTypeFromBuffer(p.ipHdr.Buffer[p.ipHdr.ipHeaderLen:])\n}", "video": "" }
{ "audio": "", "image": "", "text": " packetID,\n\t}\n\n\t// Set the fixed header to the Packet.\n\tp.fixedHeader = fixedHeader\n\n\t// Set the variable header to the Packet.\n\tp.variableHeader = variableHeader\n\n\t// Return the Packet.\n\treturn p, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func GetUDPTypeFromBuffer(buffer []byte) byte {\n\tif len(buffer) < (UDPDataPos + UDPSignatureLen) {\n\t\treturn 0\n\t}\n\n\tmarker := buffer[UDPDataPos:udpSignatureEnd]\n\n\t// check for packet signature.\n\tif !bytes.Equal(buffer[udpAuthMarkerOffset:udpSignatureEnd], []byte(...
{ "audio": "", "image": "", "text": "\tzap.L().Debug(\"Not an Aporeto control Packet\")\n\t\treturn 0\n\t}\n\t// control packet. byte 0 has packet type information.\n\treturn marker[0] & UDPPacketMask\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif i+1 < len(exprs) {\n\t\t\tbuffer.WriteString(\", \")\n\t\t}\n\t}\n\treturn buffer.Bytes()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func CreateUDPAuthMarker(packetType uint8) []byte {\n\n\t// Every UDP control packet has a 20 byte packet signature. The\n\t// first 2 bytes represent the following control information.\n\t// Byte 0 : Bits 0,1 are reserved fields.\n\t// Bits 2,3,4 represent version in...
{ "audio": "", "image": "", "text": "\n\tmarker := make([]byte, UDPSignatureLen)\n\t// ignore version info as of now.\n\tmarker[0] |= packetType // byte 0\n\tmarker[1] = 0 // byte 1\n\t// byte 2 - 19\n\tcopy(marker[2:], []byte(UDPAuthMarker))\n\n\treturn marker\n}", "video": "" }
{ "audio": "", "image": "", "text": " packetID,\n\t}\n\n\t// Set the fixed header to the Packet.\n\tp.fixedHeader = fixedHeader\n\n\t// Set the variable header to the Packet.\n\tp.variableHeader = variableHeader\n\n\t// Return the Packet.\n\treturn p, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewJWT(validity time.Duration, issuer string, s secrets.Secrets) (*JWTConfig, error) {\n\n\tif len(issuer) > MaxServerName {\n\t\treturn nil, fmt.Errorf(\"server id should be max %d chars. got %s\", MaxServerName, issuer)\n\t}\n\n\tfor i := len(issuer); i < MaxServerName;...
{ "audio": "", "image": "", "text": " signMethod,\n\t\tsecrets: s,\n\t\ttokenCache: cache.NewCacheWithExpiration(\"JWTTokenCache\", time.Millisecond*500),\n\t\tcompressionType: compressionType,\n\t\tcompressionTagLength: claimsheader.CompressionTypeToTagLength(compressionType),\n\...
{ "audio": "", "image": "", "text": " plainExpectation.GetPayload().(type) {\n\tcase *token.PlainExpectation_ImportExpectation:\n\t\tissuer, err := s.TMSManager.GetIssuer(header.ChannelId, request.Credential, header.Creator)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttokenTransaction, err = issuer.Re...
{ "audio": "", "image": "", "text": "func (c *JWTConfig) CreateAndSign(isAck bool, claims *ConnectionClaims, nonce []byte, claimsHeader *claimsheader.ClaimsHeader) (token []byte, err error) {\n\n\t// Combine the application claims with the standard claims\n\tallclaims := &JWTClaims{\n\t\tclaims,\n\t\tjwt.Standard...
{ "audio": "", "image": "", "text": "\n\tstrtoken, err := jwt.NewWithClaims(c.signMethod, allclaims).SignedString(c.secrets.EncodingKey())\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\n\t// Copy the certificate if needed. Note that we don't send the certificate\n\t// again for Ack packets to reduce overhea...
{ "audio": "", "image": "", "text": " item with delay\", zap.String(\"key\", fmt.Sprintf(\"%v\", u)), zap.String(\"delay\", duration.String()))\n\t\t}\n\t})\n\n\tt := time.Now()\n\n\tif c.data[u].timer != nil {\n\t\tc.data[u].timer.Stop()\n\t}\n\n\tc.data[u] = entry{\n\t\tvalue: e.value,\n\t\ttimestamp: t,\n\...
{ "audio": "", "image": "", "text": "func (c *JWTConfig) Randomize(token []byte, nonce []byte) (err error) {\n\n\tif len(token) < tokenPosition {\n\t\treturn errors.New(\"token is too", "video": "" }
{ "audio": "", "image": "", "text": " small\")\n\t}\n\n\tcopy(token[noncePosition:], nonce)\n\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " \"true\"\n\n\t//some error checking ...\n\tswitch {\n\tcase len(token.token) == 0 : return nil, errors.New(str)\n\tcase len(token.secret) == 0 : return nil, errors.New(str)\n\t}\n\n\treturn &token, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *JWTConfig) RetrieveNonce(token []byte) ([]byte, error) {\n\n\tif len(token) < tokenPosition {\n\t\treturn []byte{}, errors.New(\"invalid token\")\n\t}\n\n\tnonce :=", "video": "" }
{ "audio": "", "image": "", "text": " make([]byte, NonceLength)\n\tcopy(nonce, token[noncePosition:tokenPosition])\n\n\treturn nonce, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " \"true\"\n\n\t//some error checking ...\n\tswitch {\n\tcase len(token.token) == 0 : return nil, errors.New(str)\n\tcase len(token.secret) == 0 : return nil, errors.New(str)\n\t}\n\n\treturn &token, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func addTransmitterLabel(contextID string, containerInfo *policy.PUInfo) {\n\n\tif containerInfo.Policy.ManagementID() == \"\" {\n\t\tcontainerInfo.Policy.AddIdentityTag(enforcerconstants.TransmitterLabel,", "video": "" }
{ "audio": "", "image": "", "text": " contextID)\n\t} else {\n\t\tcontainerInfo.Policy.AddIdentityTag(enforcerconstants.TransmitterLabel, containerInfo.Policy.ManagementID())\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " out *policy.PodSecurityPolicyList, s conversion.Scope) error {\n\treturn autoConvert_v1beta1_PodSecurityPolicyList_To_policy_PodSecurityPolicyList(in, out, s)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorLinuxExtractor(extractor extractors.EventMetadataExtractor) LinuxMonitorOption {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " func(cfg *linuxmonitor.Config) {\n\t\tcfg.EventMetadataExtractor = extractor\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif strings.HasSuffix(source, suffix) {\n\t\t\treturn extractor, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"no extractor implemented yet for %s\", source)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorCNIExtractor(extractor extractors.EventMetadataExtractor) CNIMonitorOption {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " func(cfg *cnimonitor.Config) {\n\t\tcfg.EventMetadataExtractor = extractor\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif strings.HasSuffix(source, suffix) {\n\t\t\treturn extractor, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"no extractor implemented yet for %s\", source)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorUIDExtractor(extractor extractors.EventMetadataExtractor) UIDMonitorOption {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " func(cfg *uidmonitor.Config) {\n\t\tcfg.EventMetadataExtractor = extractor\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif strings.HasSuffix(source, suffix) {\n\t\t\treturn extractor, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"no extractor implemented yet for %s\", source)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorSSHExtractor(extractor extractors.EventMetadataExtractor) LinuxMonitorOption {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " func(cfg *linuxmonitor.Config) {\n\t\tcfg.EventMetadataExtractor = extractor\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif strings.HasSuffix(source, suffix) {\n\t\t\treturn extractor, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"no extractor implemented yet for %s\", source)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorDockerExtractor(extractor extractors.DockerMetadataExtractor) DockerMonitorOption {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " func(cfg *dockermonitor.Config) {\n\t\tcfg.EventMetadataExtractor = extractor\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif strings.HasSuffix(source, suffix) {\n\t\t\treturn extractor, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"no extractor implemented yet for %s\", source)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorDockerSocket(socketType, socketAddress string) DockerMonitorOption", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(cfg *dockermonitor.Config) {\n\t\tcfg.SocketType = socketType\n\t\tcfg.SocketAddress = socketAddress\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\treturn fmt.Sprintf(\"%s://%s\", e.scheme(), e.SocketAddress())\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorDockerFlags(syncAtStart, killContainerOnPolicyError bool) DockerMonitorOption", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(cfg *dockermonitor.Config) {\n\t\tcfg.KillContainerOnPolicyError = killContainerOnPolicyError\n\t\tcfg.SyncAtStart = syncAtStart\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " bool {\n\treturn func(err error) bool {\n\t\treturn Cause(err) == cause\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorKubernetesKubeconfig(kubeconfig string) KubernetesMonitorOption {\n\treturn func(cfg", "video": "" }
{ "audio": "", "image": "", "text": " *kubernetesmonitor.Config) {\n\t\tcfg.Kubeconfig = kubeconfig\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " func(cfg *config) {\n\t\tcfg.runtimeCfg = c\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorKubernetesNodename(nodename string) KubernetesMonitorOption {\n\treturn func(cfg", "video": "" }
{ "audio": "", "image": "", "text": " *kubernetesmonitor.Config) {\n\t\tcfg.Nodename = nodename\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " *podmonitor.Config) {\n\t\tcfg.Nodename = nodename\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorKubernetesHostPod(enableHostPods bool) KubernetesMonitorOption {\n\treturn func(cfg", "video": "" }
{ "audio": "", "image": "", "text": " *kubernetesmonitor.Config) {\n\t\tcfg.EnableHostPods = enableHostPods\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " bool {\n\treturn func(err error) bool {\n\t\treturn Cause(err) == cause\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorKubernetesExtractor(extractor extractors.KubernetesMetadataExtractorType) KubernetesMonitorOption {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " func(cfg *kubernetesmonitor.Config) {\n\t\tcfg.KubernetesExtractor = extractor\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif strings.HasSuffix(source, suffix) {\n\t\t\treturn extractor, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"no extractor implemented yet for %s\", source)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorKubernetesDockerExtractor(extractor extractors.DockerMetadataExtractor) KubernetesMonitorOption {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " func(cfg *kubernetesmonitor.Config) {\n\t\tcfg.DockerExtractor = extractor\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif strings.HasSuffix(source, suffix) {\n\t\t\treturn extractor, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"no extractor implemented yet for %s\", source)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorPodKubeconfig(kubeconfig string) PodMonitorOption {\n\treturn func(cfg", "video": "" }
{ "audio": "", "image": "", "text": " *podmonitor.Config) {\n\t\tcfg.Kubeconfig = kubeconfig\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " func(cfg *config) {\n\t\tcfg.runtimeCfg = c\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorPodNodename(nodename string) PodMonitorOption {\n\treturn func(cfg", "video": "" }
{ "audio": "", "image": "", "text": " *podmonitor.Config) {\n\t\tcfg.Nodename = nodename\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " func(cfg *config) {\n\t\tcfg.runtimeCfg = c\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorPodActivateHostPods(enableHostPods bool) PodMonitorOption {\n\treturn func(cfg", "video": "" }
{ "audio": "", "image": "", "text": " *podmonitor.Config) {\n\t\tcfg.EnableHostPods = enableHostPods\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " bool {\n\treturn func(err error) bool {\n\t\treturn Cause(err) == cause\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorPodMetadataExtractor(extractor extractors.PodMetadataExtractor) PodMonitorOption {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " func(cfg *podmonitor.Config) {\n\t\tcfg.MetadataExtractor = extractor\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif strings.HasSuffix(source, suffix) {\n\t\t\treturn extractor, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"no extractor implemented yet for %s\", source)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func SubOptionMonitorPodNetclsProgrammer(netclsprogrammer extractors.PodNetclsProgrammer) PodMonitorOption {\n\treturn", "video": "" }
{ "audio": "", "image": "", "text": " func(cfg *podmonitor.Config) {\n\t\tcfg.NetclsProgrammer = netclsprogrammer\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " -1 {\n\t\treturn formulaTable[fmtForms(FormsTable[idx].Value)]\n\t}\n\treturn func(n int) int {\n\t\treturn n\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func OptionCollector(c collector.EventCollector) Options {\n\treturn func(cfg", "video": "" }
{ "audio": "", "image": "", "text": " *config.MonitorConfig) {\n\t\tcfg.Common.Collector = c\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\treturn func(c *config) {\n\t\tc.tracerOptions.Collector.Host = satelliteHost\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func OptionPolicyResolver(p policy.Resolver) Options {\n\treturn func(cfg", "video": "" }
{ "audio": "", "image": "", "text": " *config.MonitorConfig) {\n\t\tcfg.Common.Policy = p\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(options *eventOptions) {\n\t\toptions.relatedActivityID = activityID\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewMonitor(opts ...Options) *config.MonitorConfig {\n\n\tcfg := &config.MonitorConfig{\n\t\tMonitors: make(map[config.Type]interface{}),", "video": "" }
{ "audio": "", "image": "", "text": "\n\t}\n\n\tfor _, opt := range opts {\n\t\topt(cfg)\n\t}\n\n\treturn cfg\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\n\tvar cfg opts.GetConfig\n\tfor _, o := range getOpts {\n\t\to(&cfg)\n\t}\n\n\tif cfg.ResolveStatus {\n\t\tvol.Status = v.Status()\n\t}\n\treturn &vol, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) AddEthernetLayer(srcMACstr string, dstMACstr string) error {\n\n\tif p.ethernetLayer != nil {\n\t\treturn errors.New(\"ethernet layer already exists\")\n\t}\n\n\tvar srcMAC, dstMAC net.HardwareAddr\n\n\t//MAC address of the source\n\tsrcMAC, _ = net.ParseMAC(s...
{ "audio": "", "image": "", "text": "\t\treturn errors.New(\"no destination mac given\")\n\t}\n\n\t//Ethernet packet header\n\tp.ethernetLayer = &layers.Ethernet{\n\t\tSrcMAC: srcMAC,\n\t\tDstMAC: dstMAC,\n\t\tEthernetType: layers.EthernetTypeIPv4,\n\t}\n\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " to bind specified\")\n\t}\n\tif c.TLSCertPath == \"\" {\n\t\treturn errors.New(\"no tls certificate\")\n\t}\n\tif c.TLSPrivateKeyPath == \"\" {\n\t\treturn errors.New(\"no private key\")\n\t}\n\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) AddIPLayer(srcIPstr string, dstIPstr string) error {\n\n\tif p.ipLayer != nil {\n\t\treturn errors.New(\"ip layer already exists\")\n\t}\n\n\tvar srcIP, dstIP net.IP\n\n\t//IP address of the source\n\tsrcIP = net.ParseIP(srcIPstr)\n\n\tif srcIP == nil {\n\t\tr...
{ "audio": "", "image": "", "text": " given\")\n\t}\n\n\t//IP packet header\n\tp.ipLayer = &layers.IPv4{\n\t\tSrcIP: srcIP,\n\t\tDstIP: dstIP,\n\t\tVersion: 4,\n\t\tTTL: 64,\n\t\tProtocol: layers.IPProtocolTCP,\n\t}\n\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " IP := net.ParseIP(ip); IP != nil && IsPublicIP(IP) {\n\t\t\treturn ip\n\t\t}\n\t}\n\treturn \"\"\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) AddTCPLayer(srcPort layers.TCPPort, dstPort layers.TCPPort) error {\n\n\tif p.tcpLayer != nil {\n\t\treturn errors.New(\"tcp layer already exists\")\n\t}\n\n\tif srcPort == 0 {\n\t\treturn errors.New(\"no source tcp port given\")\n\t}\n\n\tif dstPort == 0 {\n\...
{ "audio": "", "image": "", "text": " 0,\n\t\tAck: 0,\n\t\tACK: false,\n\t\tSYN: false,\n\t\tFIN: false,\n\t\tRST: false,\n\t\tURG: false,\n\t\tECE: false,\n\t\tCWR: false,\n\t\tNS: false,\n\t\tPSH: false,\n\t}\n\n\treturn p.tcpLayer.SetNetworkLayerForChecksum(p.ipLaye...
{ "audio": "", "image": "", "text": " to bind specified\")\n\t}\n\tif c.TLSCertPath == \"\" {\n\t\treturn errors.New(\"no tls certificate\")\n\t}\n\tif c.TLSPrivateKeyPath == \"\" {\n\t\treturn errors.New(\"no private key\")\n\t}\n\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) SetTCPSynAck() {\n\n\tp.tcpLayer.SYN = true\n\tp.tcpLayer.ACK", "video": "" }
{ "audio": "", "image": "", "text": " = true\n\tp.tcpLayer.FIN = false\n}", "video": "" }
{ "audio": "", "image": "", "text": "\treturn func(p *ProgressBar) {\n\t\tp.config.width = s\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) NewTCPPayload(newPayload string) error {\n\n\tif p.tcpLayer.Payload != nil {\n\t\treturn errors.New(\"payload already exists\")", "video": "" }
{ "audio": "", "image": "", "text": "\n\t}\n\n\tp.tcpLayer.Payload = []byte(newPayload)\n\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(p *Prompt) error {\n\t\tp.keyBindMode = m\n\t\treturn nil\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *Packet) DecodePacket() PacketManipulator {\n\n\tpacketData := &Packet{\n\t\tethernetLayer: &layers.Ethernet{},\n\t\tipLayer: &layers.IPv4{},\n\t\ttcpLayer: &layers.TCP{},\n\t}\n\n\tnewEthernetPacket := packetData.GetEthernetPacket()\n\tnewIPPacket := packet...
{ "audio": "", "image": "", "text": " = tcp.Seq\n\t\tnewTCPPacket.Ack = tcp.Ack\n\t\tnewTCPPacket.SYN = tcp.SYN\n\t\tnewTCPPacket.FIN = tcp.FIN\n\t\tnewTCPPacket.RST = tcp.RST\n\t\tnewTCPPacket.PSH = tcp.PSH\n\t\tnewTCPPacket.ACK = tcp.ACK\n\t\tnewTCPPacket.URG = tcp.URG\n\t\tnewTCPPacket.ECE = tcp.ECE\n\t\tnewTC...
{ "audio": "", "image": "", "text": " host\")\n\n\tfor _, addr := range addrs {\n\t\tvar ip net.IP\n\t\tswitch v := addr.(type) {\n\t\tcase *net.IPNet:\n\t\t\tip = v.IP\n\t\tcase *net.IPAddr:\n\t\t\tip = v.IP\n\t\t}\n\n\t\tif ip.To4() != nil {\n\t\t\tipList.Add(ip.String())\n\t\t}\n\t}\n\n\treturn ipList\n}", "...
{ "audio": "", "image": "", "text": "func NewPacketFlow(smac string, dmac string, sip string, dip string, sport layers.TCPPort, dport layers.TCPPort) PacketFlowManipulator {\n\n\tinitialTupules := &PacketFlow{\n\t\tsMAC: smac,\n\t\tdMAC: dmac,\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\tsIP: sip,\n\t\tdIP: dip,\n\t\tsPort: sport,\n\t\tdPort: dport,\n\t\tflow: make([]PacketManipulator, 0),\n\t}\n\n\treturn initialTupules\n}", "video": "" }
{ "audio": "", "image": "", "text": " string, _ string) (string, error) {\n\treturn \"\", nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *PacketFlow) AppendPacket(pm PacketManipulator) int {\n\n", "video": "" }
{ "audio": "", "image": "", "text": "\tp.flow = append(p.flow, pm)\n\n\treturn p.GetNumPackets()\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif err != nil {\n\t\treturn err\n\t}\n\tif err := p.Set(args); err != nil {\n\t\treturn err\n\t}\n\treturn pm.save(p)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (p *PacketFlow) getMatchPackets(syn, ack, fin bool) PacketFlowManipulator {\n\n\tpacketsInFlow := NewPacketFlow(p.sMAC, p.dMAC, p.sIP, p.dIP, p.sPort, p.dPort)\n\n\tfor j := 0; j < len(p.flow); j++ {\n\t\tif p.flow[j].GetTCPSyn() == syn", "video": "" }
{ "audio": "", "image": "", "text": " && p.flow[j].GetTCPAck() == ack && p.flow[j].GetTCPFin() == fin {\n\t\t\tpacketsInFlow.AppendPacket(p.flow[j])\n\t\t}\n\t}\n\n\treturn packetsInFlow\n}", "video": "" }
{ "audio": "", "image": "", "text": " if len(comment) == 3 {\n\t\t\t_ = p.googleBot()\n\t\t}\n\t} else if len(comment) > 0 {\n\t\tif len(comment) > 3 {\n\t\t\tp.localization = comment[3]\n\t\t}\n\t\tif strings.HasPrefix(comment[0], \"Windows NT\") {\n\t\t\tp.os = normalizeOS(comment[0])\n\t\t} else if len(comment...
{ "audio": "", "image": "", "text": "func (p *PacketFlow) GetUptoFirstSynAckPacket() PacketFlowManipulator {\n\n\tpacketsInFlow := NewPacketFlow(p.sMAC, p.dMAC, p.sIP, p.dIP, p.sPort, p.dPort)\n\tflag := false\n\n\tfor j := 0; j < len(p.flow); j++ {\n\t\tif !flag {", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\t\tpacketsInFlow.AppendPacket(p.flow[j])\n\t\t\tif p.flow[j].GetTCPSyn() && p.flow[j].GetTCPAck() && !p.flow[j].GetTCPFin() {\n\t\t\t\tflag = true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn packetsInFlow\n}", "video": "" }
{ "audio": "", "image": "", "text": " base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf(\"%v:%v\", p.Username, p.Password)))\n\t}\n\n\tif p.Concurrency < 1 {\n\t\tp.Concurrency = 1\n\t}\n\n\tclient := &Client{\n\t\turl: u,\n\t\tTenant: p.Tenant,\n\t\tCredentials: creds,\n\t\tToken: p.Token,\...
{ "audio": "", "image": "", "text": "func (p *PacketFlow) GetNthPacket(index int) PacketManipulator {\n\n\tfor i :=", "video": "" }
{ "audio": "", "image": "", "text": " 0; i < len(p.flow); i++ {\n\t\tif index == i {\n\t\t\treturn p.flow[i]\n\t\t}\n\t}\n\n\tpanic(\"Index out of range\")\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\tfill := utils.FillColor(val)\n\t\tstripeWidth := val + 5\n\n\t\tstyles := make(map[string]interface{})\n\t\tstyles[\"opacity\"] = opacity\n\t\tstyles[\"fill\"] = fill\n\n\t\tp.Svg.Rect(width, 0, stripeWidth, \"100%\", styles)\n\n\t\twidth = width + int(stripeWidth)\n\t\t...
{ "audio": "", "image": "", "text": "func ConvertServicesToPortList(services []Service) string {\n\n\tportlist := \"\"\n\tfor _, s := range services {\n\t\tportlist = portlist + s.Ports.String() + \",\"\n\t}\n\n\tif len(portlist) == 0 {\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\tportlist = \"0\"\n\t} else {\n\t\tportlist = portlist[:len(portlist)-1]\n\t}\n\n\treturn portlist\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tfor s := range d.myAdvertisedServices {\n\t\tservices = append(services, s)\n\t}\n\td.watchedMutex.RUnlock()\n\tfor _, serviceName := range services {\n\t\td.DeleteAdvertisedService(serviceName)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewDebugClient(cr statscollector.Collector) (DebugClient, error) {\n\td := &debugClient{\n\t\tcollector: cr,\n\t\trpchdl: rpcwrapper.NewRPCWrapper(),\n\t\tsecret: os.Getenv(constants.EnvStatsSecret),\n\t\tdebugChannel: os.Getenv(constants.EnvStatsChanne...
{ "audio": "", "image": "", "text": " make(chan bool),\n\t}\n\n\tif d.debugChannel == \"\" {\n\t\treturn nil, errors.New(\"no path to debug socket provided\")\n\t}\n\n\tif d.secret == \"\" {\n\t\treturn nil, errors.New(\"no secret provided for debug channel\")\n\t}\n\n\treturn d, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " //Power\n\t\t\t\"/usr/local/Cellar/softhsm/2.1.0/lib/softhsm/libsofthsm2.so\", //MacOS\n\t\t}\n\t\tfor _, path := range possibilities {\n\t\t\tif _, err := os.Stat(path); !os.IsNotExist(err) {\n\t\t\t\tlib = path\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t} else {\n\t\tpin = os.Getenv...
{ "audio": "", "image": "", "text": "func CreateSocket(mark int, deviceName string) (SocketWriter, error) {\n\tfd, _ := syscall.Socket(syscall.AF_INET, syscall.SOCK_RAW, syscall.IPPROTO_RAW)\n\tif err := syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_MARK, mark); err != nil {\n\t\tsyscall.Close(fd) // n...
{ "audio": "", "image": "", "text": " syscall.IPPROTO_IP, syscall.IP_HDRINCL, 1); err != nil {\n\t\tsyscall.Close(fd) // nolint\n\t\treturn nil, fmt.Errorf(\"Received error %s while setting socket Option IP_HDRINCL\", err)\n\t}\n\tinsock := &syscall.SockaddrInet4{\n\t\tPort: 0,\n\t}\n\n\treturn &rawsocket{\n\t\tf...
{ "audio": "", "image": "", "text": " {\n\t\t\terr = fmt.Errorf(\"serial: could not select: %v\", err)\n\t\t\treturn\n\t\t}\n\t}\n\tif !fdisset(fd, &rfds) {\n\t\t// Timeout\n\t\terr = ErrTimeout\n\t\treturn\n\t}\n\tn, err = syscall.Read(fd, b)\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewPUInfo(contextID string, puType common.PUType) *PUInfo {\n\tpolicy := NewPUPolicy(contextID, AllowAll, nil, nil, nil,", "video": "" }
{ "audio": "", "image": "", "text": " nil, nil, nil, nil, nil, 0, nil, nil, []string{})\n\truntime := NewPURuntime(\"\", 0, \"\", nil, nil, puType, nil)\n\treturn PUInfoFromPolicyAndRuntime(contextID, policy, runtime)\n}", "video": "" }
{ "audio": "", "image": "", "text": " string) (string, []byte, bool) {\n\treturn \"\", nil, false\n}", "video": "" }
{ "audio": "", "image": "", "text": "func PUInfoFromPolicyAndRuntime(contextID string, policyInfo *PUPolicy, runtimeInfo *PURuntime) *PUInfo {\n\treturn &PUInfo{\n\t\tContextID:", "video": "" }
{ "audio": "", "image": "", "text": " contextID,\n\t\tPolicy: policyInfo,\n\t\tRuntime: runtimeInfo,\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " string, _ string) (string, error) {\n\treturn \"\", nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func ErrPUNotFound(puID string, err error) error {\n\treturn &Error{\n\t\tpuID: puID,", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\treason: PUNotFound,\n\t\terr: err,\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " string, vlanId string) error {\n\treturn hyperv.SetNetworkAdapterVlanId(switchName, vlanId)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func ErrPUNotUnique(puID string, err error) error {\n\treturn &Error{\n\t\tpuID: puID,", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\treason: PUNotUnique,\n\t\terr: err,\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " string, vlanId string) error {\n\treturn hyperv.SetNetworkAdapterVlanId(switchName, vlanId)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func ErrPUCreateFailed(puID string, err error) error {\n\treturn &Error{\n\t\tpuID: ", "video": "" }
{ "audio": "", "image": "", "text": " puID,\n\t\treason: PUCreateFailed,\n\t\terr: err,\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " string, vlanId string) error {\n\treturn hyperv.SetNetworkAdapterVlanId(switchName, vlanId)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func ErrPUAlreadyActivated(puID string, err error) error {\n\treturn &Error{\n\t\tpuID: ", "video": "" }
{ "audio": "", "image": "", "text": " puID,\n\t\treason: PUAlreadyActivated,\n\t\terr: err,\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " string, vlanId string) error {\n\treturn hyperv.SetNetworkAdapterVlanId(switchName, vlanId)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func ErrPUPolicyPending(puID string, err error) error {\n\treturn &Error{\n\t\tpuID: ", "video": "" }
{ "audio": "", "image": "", "text": " puID,\n\t\treason: PUPolicyPending,\n\t\terr: err,\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " string, vlanId string) error {\n\treturn hyperv.SetNetworkAdapterVlanId(switchName, vlanId)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func ErrPUPolicyEnforcementFailed(puID string, err error) error {\n\treturn &Error{\n\t\tpuID: ", "video": "" }
{ "audio": "", "image": "", "text": " puID,\n\t\treason: PUPolicyEnforcementFailed,\n\t\terr: err,\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " string, vlanId string) error {\n\treturn hyperv.SetNetworkAdapterVlanId(switchName, vlanId)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func IsErrPUNotFound(err error) bool {\n\tswitch t := err.(type)", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tcase *Error:\n\t\treturn t.reason == PUNotFound\n\tdefault:\n\t\treturn false\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " bool {\n\treturn func(err error) bool {\n\t\treturn Cause(err) == cause\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func IsErrPUNotUnique(err error) bool {\n\tswitch t := err.(type)", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tcase *Error:\n\t\treturn t.reason == PUNotUnique\n\tdefault:\n\t\treturn false\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " bool {\n\treturn func(err error) bool {\n\t\treturn Cause(err) == cause\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func IsErrPUCreateFailed(err error) bool {\n\tswitch t := err.(type) {\n\tcase *Error:\n\t\treturn t.reason ==", "video": "" }
{ "audio": "", "image": "", "text": " PUCreateFailed\n\tdefault:\n\t\treturn false\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tswitch t := t.(type) {\n\t\tcase xml.StartElement:\n\t\t\treturn t, nil\n\t\t}\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func IsErrPUAlreadyActivated(err error) bool {\n\tswitch t := err.(type) {\n\tcase *Error:\n\t\treturn t.reason ==", "video": "" }
{ "audio": "", "image": "", "text": " PUAlreadyActivated\n\tdefault:\n\t\treturn false\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tswitch t := t.(type) {\n\t\tcase xml.StartElement:\n\t\t\treturn t, nil\n\t\t}\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func IsErrPUPolicyPending(err error) bool {\n\tswitch t := err.(type) {\n\tcase *Error:\n\t\treturn t.reason ==", "video": "" }
{ "audio": "", "image": "", "text": " PUPolicyPending\n\tdefault:\n\t\treturn false\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tswitch t := t.(type) {\n\t\tcase xml.StartElement:\n\t\t\treturn t, nil\n\t\t}\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func IsErrPUEnforcementFailed(err error) bool {\n\tswitch t := err.(type) {\n\tcase *Error:\n\t\treturn t.reason ==", "video": "" }
{ "audio": "", "image": "", "text": " PUPolicyEnforcementFailed\n\tdefault:\n\t\treturn false\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tswitch t := t.(type) {\n\t\tcase xml.StartElement:\n\t\t\treturn t, nil\n\t\t}\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func ExecuteCommandFromArguments(arguments map[string]interface{}) error {\n\n\tp := NewRequestProcessor()", "video": "" }
{ "audio": "", "image": "", "text": "\n\n\tc, err := p.ParseCommand(arguments)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn p.ExecuteRequest(c)\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(p *Prompt) error {\n\t\tp.keyBindMode = m\n\t\treturn nil\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewCustomRequestProcessor(address string) *RequestProcessor {\n\tr := NewRequestProcessor()\n\n\tif address", "video": "" }
{ "audio": "", "image": "", "text": " != \"\" {\n\t\tr.address = address\n\t}\n\n\treturn r\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\tif word, ok := m.(*Word); ok {\n\t\t\tif word.Address == address {\n\t\t\t\tres = append(res, word.Command)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (r *RequestProcessor) CreateAndRun(c *CLIRequest) error {\n\tvar err error\n\n\t// If its not hostPolicy and the command doesn't exist we return an error\n\tif !c.HostPolicy {\n\t\tif c.Executable == \"\" {\n\t\t\treturn errors.New(\"command must be provided\")\n\t\t}\n\t...
{ "audio": "", "image": "", "text": " is added since the release_notification comes in this format\n\t// Easier to massage it while creation rather than change at the receiving end depending on event\n\trequest := &common.EventInfo{\n\t\tPUType: puType,\n\t\tName: c.ServiceName,\n\t\tExe...
{ "audio": "", "image": "", "text": "\t\t\tlogger.Warningf(\"bootstrap parameters could not be opened: %v\", err)\n\t\t}\n\t}\n\tif environ == nil {\n\t\tlogger.Infof(\"no model found, creating image metadata using user supplied data\")\n\t}\n\tif c.Series == \"\" {\n\t\tc.Series = version.SupportedLTS()\n\t}\n\t...
{ "audio": "", "image": "", "text": "func (r *RequestProcessor) DeleteService(c *CLIRequest) error {\n\n\trequest := &common.EventInfo{\n\t\tPUType: common.LinuxProcessPU,\n\t\tPUID: c.ServiceName,\n\t\tEventType: common.EventStop,\n\t\tHostService: c.HostPolicy,\n\t}\n\n\tif c.UIDPolicy {\n\t\trequ...
{ "audio": "", "image": "", "text": "\n\t// Send Stop request\n\tif err := sendRequest(r.address, request); err != nil {\n\t\treturn err\n\t}\n\n\t// Send destroy request\n\trequest.EventType = common.EventDestroy\n\n\treturn sendRequest(r.address, request)\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\t\tresults.Results[i].Error = common.ServerError(common.ErrPerm)\n\t\t\tcontinue\n\t\t}\n\t\taccess, err := c.state.UserPermission(userTag, c.state.ControllerTag())\n\t\tif err != nil {\n\t\t\tresults.Results[i].Error = common.ServerError(err)\n\t\t\tcontinue\n\t\t}\n\t...
{ "audio": "", "image": "", "text": "func (r *RequestProcessor) DeleteCgroup(c *CLIRequest) error {\n\tregexCgroup := regexp.MustCompile(`^/trireme/(ssh-)?[a-zA-Z0-9_\\-:.$%]{1,64}$`)\n\tregexUser := regexp.MustCompile(`^/trireme_uid/[a-zA-Z0-9_\\-]{1,32}(/[0-9]{1,32}){0,1}$`)\n\n\tif !regexCgroup.Match([]byte(c....
{ "audio": "", "image": "", "text": "\teventPUID = c.Cgroup[len(common.TriremeCgroupPath):]\n\t} else {\n\t\t// Not our Cgroup\n\t\treturn nil\n\t}\n\n\trequest := &common.EventInfo{\n\t\tPUType: eventType,\n\t\tPUID: eventPUID,\n\t\tEventType: common.EventStop,\n\t}\n\n\t// Send Stop request\n\tif err :=...
{ "audio": "", "image": "", "text": "\n\t\t}\n\t}\n\n\tif event.EventType == common.EventStop || event.EventType == common.EventDestroy {\n\t\tregStop := regexp.MustCompile(\"^/trireme/[a-zA-Z0-9_]{1,11}$\")\n\t\tif event.Cgroup != \"\" && !regStop.Match([]byte(event.Cgroup)) {\n\t\t\treturn fmt.Errorf(\"Cgroup i...
{ "audio": "", "image": "", "text": "func (r *RequestProcessor) ExecuteRequest(c *CLIRequest) error {\n\n\tswitch c.Request {\n\tcase CreateRequest:\n\t\treturn r.CreateAndRun(c)\n\tcase DeleteCgroupRequest:\n\t\treturn r.DeleteCgroup(c)\n\tcase", "video": "" }
{ "audio": "", "image": "", "text": " DeleteServiceRequest:\n\t\treturn r.DeleteService(c)\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown request: %d\", c.Request)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\t\t}\n\t\t}\n\t\treturn nil\n\n\tcase *UserPartMessage:\n\t\tif c.handleUserPartMessage(*msg) {\n\t\t\tif c.onUserPartMessage != nil {\n\t\t\t\tc.onUserPartMessage(*msg)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\n\tcase *ReconnectMessage:\n\t\t// https://dev.twitch.tv/docs/irc/co...
{ "audio": "", "image": "", "text": "func sendRequest(address string, event *common.EventInfo) error {\n\n\tclient,", "video": "" }
{ "audio": "", "image": "", "text": " err := client.NewClient(address)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn client.SendRequest(event)\n}", "video": "" }
{ "audio": "", "image": "", "text": " string, err error) {\n\treturn s.SendRequest(connID, method, params, resHandler)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func ParseServices(ports []string) ([]common.Service, error) {\n\n\t// If no ports are provided, we add the default 0 port\n\tif len(ports) == 0 {\n\t\tports = append(ports, \"0\")\n\t}\n\n\t// Parse the ports and create the services. Cleanup any bad ports\n\tservices := []com...
{ "audio": "", "image": "", "text": "\t\t\t\treturn nil, fmt.Errorf(\"Invalid protocol specified. Only tcp/udp accepted\")\n\t\t\t}\n\t\t}\n\n\t\ts, err := portspec.NewPortSpecFromString(portProtocolPair[0], nil)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Invalid port spec: %s \", err)\n\t\t}\n\n\t\tser...
{ "audio": "", "image": "", "text": " the ports and generate a named listener for\n\t\t// each port.\n\t\tfor _, port := range svc.Ports {\n\t\t\t// Only listen on ServicePorts\n\t\t\tif port.ServicePort < 1 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tlisteners = append(listeners, s.EnvoyListenerFromService(svc, port.S...
{ "audio": "", "image": "", "text": "func ComputeHmac256(tags []byte, key []byte) ([]byte, error) {\n\n\tvar buffer bytes.Buffer\n\tif err := binary.Write(&buffer, binary.BigEndian, tags); err != nil {\n\t\treturn []byte{}, err\n\t}\n\n\th := hmac.New(sha256.New, key)", "video": "" }
{ "audio": "", "image": "", "text": "\n\n\tif _, err := h.Write(buffer.Bytes()); err != nil {\n\t\treturn []byte{}, err\n\t}\n\n\treturn h.Sum(nil), nil\n\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tm := hmac.New(sha256.New, key)\n\tm.Write(msg)\n\treturn m.Sum(nil)[:size]\n}", "video": "" }
{ "audio": "", "image": "", "text": "func VerifyHmac(tags []byte, expectedMAC []byte, key []byte) bool {\n\tmessageMAC, err := ComputeHmac256(tags, key)\n\tif err != nil", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\treturn false\n\t}\n\n\treturn hmac.Equal(messageMAC, expectedMAC)\n}", "video": "" }
{ "audio": "", "image": "", "text": " err error) ([]byte, error) {\n\treturn swaggerData, err\n}", "video": "" }
{ "audio": "", "image": "", "text": "func GenerateRandomBytes(n int) ([]byte, error) {\n\tb := make([]byte, n)\n\t_, err := rand.Read(b)\n\n\tif err != nil {\n\t\tzap.L().Debug(\"GenerateRandomBytes failed\", zap.Error(err))\n\t\treturn", "video": "" }
{ "audio": "", "image": "", "text": " nil, err\n\t}\n\n\ts := base64.StdEncoding.EncodeToString(b)\n\n\treturn []byte(s[:n]), nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tb := make([]byte, stat.Size())\n\trand.Read(b)\n\t_, err = file.Write(b)\n\n\terr = os.Remove(fpath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn err\n}", "video": "" }
{ "audio": "", "image": "", "text": "func GenerateRandomString(s int) (string, error) {\n\tb, err := GenerateRandomBytes(s)\n", "video": "" }
{ "audio": "", "image": "", "text": "\treturn base64.URLEncoding.EncodeToString(b), err\n}", "video": "" }
{ "audio": "", "image": "", "text": " string, err error) {\n\treturn s.SendRequest(connID, method, params, resHandler)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func LoadRootCertificates(rootPEM []byte) *x509.CertPool {\n\n\troots := x509.NewCertPool()\n\n\tok := roots.AppendCertsFromPEM(rootPEM)", "video": "" }
{ "audio": "", "image": "", "text": "\n\tif !ok {\n\t\tzap.L().Error(\"AppendCertsFromPEM failed\", zap.ByteString(\"rootPEM\", rootPEM))\n\t\treturn nil\n\t}\n\n\treturn roots\n\n}", "video": "" }
{ "audio": "", "image": "", "text": " := []string{\"\"}\n\t\tm.Roots = &defaultRoots\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func LoadEllipticCurveKey(keyPEM []byte) (*ecdsa.PrivateKey, error) {\n\n\tblock, _ := pem.Decode(keyPEM)\n\tif block == nil {\n\t\treturn nil, fmt.Errorf(\"LoadElliticCurveKey", "video": "" }
{ "audio": "", "image": "", "text": " bad pem block: %s\", string(keyPEM))\n\t}\n\n\t// Parse the key\n\tkey, err := x509.ParseECPrivateKey(block.Bytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn key, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tfmt.Println(err)\n\t\treturn nil\n\t}\n\t// decode pem\n\tblock, _ := pem.Decode(derBytes)\n\tif block != nil {\n\t\tderBytes = block.Bytes\n\t}\n\treturn derBytes\n}", "video": "" }
{ "audio": "", "image": "", "text": "func LoadAndVerifyCertificate(certPEM []byte, roots *x509.CertPool) (*x509.Certificate, error) {\n\n\tcert, err := LoadCertificate(certPEM)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\topts := x509.VerifyOptions{", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\tRoots: roots,\n\t}\n\n\tif _, err := cert.Verify(opts); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn cert, nil\n\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tresponse, err := checkResp(c.HTTPClient.Do(request))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar av ArtifactVersion\n\tif err := decodeJSON(response, &av); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif opts.File != nil {\n\t\tif err := c.putFile(av.UploadPath, opt...
{ "audio": "", "image": "", "text": "func LoadAndVerifyECSecrets(keyPEM, certPEM, caCertPEM []byte) (key *ecdsa.PrivateKey, cert *x509.Certificate, rootCertPool *x509.CertPool, err error) {\n\n\t// Parse the key\n\tkey, err = LoadEllipticCurveKey(keyPEM)\n\tif err != nil {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\treturn nil, nil, nil, err\n\t}\n\n\trootCertPool = LoadRootCertificates(caCertPEM)\n\tif rootCertPool == nil {\n\t\treturn nil, nil, nil, errors.New(\"unable to load root certificate pool\")\n\t}\n\n\tcert, err = LoadAndVerifyCertificate(certPEM, rootCertPool)\n\tif err !=...
{ "audio": "", "image": "", "text": " \"CERTIFICATE\", Bytes: certBytes})\n\tkeypem := pem.EncodeToMemory(pemBlockForKey(privateKey))\n\treturn certpem, keypem, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func LoadCertificate(certPEM []byte) (*x509.Certificate, error) {\n\n\t// Decode the certificate\n\tcertBlock, _ := pem.Decode(certPEM)\n\tif certBlock == nil {\n\t\treturn nil, fmt.Errorf(\"unable to parse pem block: %s\", string(certPEM))\n\t}\n\n\t// Create the", "video":...
{ "audio": "", "image": "", "text": " certificate structure\n\tcert, err := x509.ParseCertificate(certBlock.Bytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn cert, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " %s\", filename, err)\n\t}\n\tblock, _ := pem.Decode(privateKeyData)\n\tif block == nil {\n\t\treturn nil, fmt.Errorf(\"Unable to decode PEM encoded private key data: %s\", err)\n\t}\n\trsaKey, err := x509.ParsePKCS1PrivateKey(block.Bytes)\n\tif err != nil {\n\t\treturn nil, f...
{ "audio": "", "image": "", "text": "func (m *MockRPCClient) NewRPCClient(contextID, channel, rpcSecret string) error", "video": "" }
{ "audio": "", "image": "", "text": " {\n\tret := m.ctrl.Call(m, \"NewRPCClient\", contextID, channel, rpcSecret)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn func(p *Prompt) error {\n\t\tp.keyBindMode = m\n\t\treturn nil\n\t}\n}", "video": "" }