- Install devspace to access k8s easily
brew install devspace
- accessable-pod is a pod that you can access over ssh
devspace -n <accessable-pod> enter -- bash -c "echo $(cat ~/.ssh/id_rsa.pub) >> ~/.ssh/authorized_keys"
- copy local key to
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
executor, err := executor.New(executor.DefaultConfig()) | |
if err != nil { | |
logrus.Error(err) | |
} | |
// close resource before quit | |
defer executor.Close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Config struct { | |
ReqPerSeconds int | |
QueueSize int | |
NumWorkers int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func validateFunc(handler interface{}, nArgs int) (interface{}, error) { | |
method := reflect.ValueOf(handler) | |
f := reflect.Indirect(method) | |
// check type func | |
if f.Kind() != reflect.Func { | |
return f, fmt.Errorf("%T must be a Function ", f) | |
} | |
methodType := method.Type() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
error_msg="Aborting commit. Your commit must: | |
[SCOPE - which part of the source code is impacted]: <Short (72 chars or less) summary> | |
<The body, details explain what's this commit does?> | |
Issues: <Jira issue link>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.grpc.ForwardingServerCallListener.SimpleForwardingServerCallListener; | |
import io.grpc.*; | |
import lombok.extern.slf4j.Slf4j; | |
import org.lognet.springboot.grpc.GRpcGlobalInterceptor; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.core.annotation.Order; | |
import org.springframework.security.access.AccessDeniedException; | |
import org.springframework.security.authentication.AuthenticationTrustResolver; | |
import org.springframework.security.authentication.AuthenticationTrustResolverImpl; | |
import org.springframework.security.core.Authentication; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.grpc.Metadata; | |
import io.grpc.ServerCall; | |
import io.grpc.ServerCallHandler; | |
import io.grpc.ServerInterceptor; | |
import lombok.extern.slf4j.Slf4j; | |
import org.lognet.springboot.grpc.GRpcGlobalInterceptor; | |
import org.springframework.core.annotation.Order; | |
import org.springframework.security.authentication.AnonymousAuthenticationToken; | |
import org.springframework.security.core.authority.SimpleGrantedAuthority; | |
import org.springframework.security.core.context.SecurityContextHolder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.grpc.*; | |
import lombok.extern.slf4j.Slf4j; | |
import org.lognet.springboot.grpc.GRpcGlobalInterceptor; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.core.annotation.Order; | |
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; | |
import org.springframework.security.core.context.SecurityContextHolder; | |
import org.springframework.util.StringUtils; | |
import static com.google.common.base.Strings.nullToEmpty; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func worker() { | |
request, err := http.NewRequest(method, url, bytes.NewBuffer(postBody)) | |
if err != nil { | |
log.Fatalf("%v\n", err) | |
} | |
request.Header.Set("Content-Type", contentType) | |
startTime := time.Now() | |
response, err := client.Do(request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func worker() { | |
request, err := http.NewRequest(method, url, bytes.NewBuffer(postBody)) | |
if err != nil { | |
log.Fatalf("%v\n", err) | |
} | |
request.Header.Set("Content-Type", contentType) | |
startTime := time.Now() | |
response, err := client.Do(request) |
NewerOlder