Documentation ¶
Index ¶
- func NewWoodpeckerServer(queue queue.Queue, logger logging.Log, pubsub *pubsub.Publisher, ...) proto.WoodpeckerServer
- type AgentTokenClaims
- type Authorizer
- type JWTManager
- type RPC
- func (s *RPC) Done(c context.Context, strWorkflowID string, state rpc.WorkflowState) error
- func (s *RPC) Extend(c context.Context, workflowID string) error
- func (s *RPC) Init(c context.Context, strWorkflowID string, state rpc.WorkflowState) error
- func (s *RPC) Log(c context.Context, stepUUID string, rpcLogEntries []*rpc.LogEntry) error
- func (s *RPC) Next(c context.Context, agentFilter rpc.Filter) (*rpc.Workflow, error)
- func (s *RPC) RegisterAgent(ctx context.Context, info rpc.AgentInfo) (int64, error)
- func (s *RPC) ReportHealth(ctx context.Context, status string) error
- func (s *RPC) UnregisterAgent(ctx context.Context) error
- func (s *RPC) Update(c context.Context, strWorkflowID string, state rpc.StepState) error
- func (s *RPC) Wait(c context.Context, workflowID string) error
- type StreamContextWrapper
- type WoodpeckerAuthServer
- type WoodpeckerServer
- func (s *WoodpeckerServer) Done(c context.Context, req *proto.DoneRequest) (*proto.Empty, error)
- func (s *WoodpeckerServer) Extend(c context.Context, req *proto.ExtendRequest) (*proto.Empty, error)
- func (s *WoodpeckerServer) Init(c context.Context, req *proto.InitRequest) (*proto.Empty, error)
- func (s *WoodpeckerServer) Log(c context.Context, req *proto.LogRequest) (*proto.Empty, error)
- func (s *WoodpeckerServer) Next(c context.Context, req *proto.NextRequest) (*proto.NextResponse, error)
- func (s *WoodpeckerServer) RegisterAgent(c context.Context, req *proto.RegisterAgentRequest) (*proto.RegisterAgentResponse, error)
- func (s *WoodpeckerServer) ReportHealth(c context.Context, req *proto.ReportHealthRequest) (*proto.Empty, error)
- func (s *WoodpeckerServer) UnregisterAgent(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (s *WoodpeckerServer) Update(c context.Context, req *proto.UpdateRequest) (*proto.Empty, error)
- func (s *WoodpeckerServer) Version(_ context.Context, _ *proto.Empty) (*proto.VersionResponse, error)
- func (s *WoodpeckerServer) Wait(c context.Context, req *proto.WaitRequest) (*proto.Empty, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentTokenClaims ¶
type AgentTokenClaims struct { jwt.RegisteredClaims AgentID int64 `json:"agent_id"` }
UserClaims is a custom JWT claims that contains some user's information.
type Authorizer ¶
type Authorizer struct {
// contains filtered or unexported fields
}
func NewAuthorizer ¶
func NewAuthorizer(jwtManager *JWTManager) *Authorizer
func (*Authorizer) StreamInterceptor ¶
func (a *Authorizer) StreamInterceptor(srv any, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
func (*Authorizer) UnaryInterceptor ¶
func (a *Authorizer) UnaryInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error)
type JWTManager ¶
type JWTManager struct {
// contains filtered or unexported fields
}
JWTManager is a JSON web token manager.
func NewJWTManager ¶
func NewJWTManager(secretKey string) *JWTManager
NewJWTManager returns a new JWT manager.
func (*JWTManager) Generate ¶
func (manager *JWTManager) Generate(agentID int64) (string, error)
Generate generates and signs a new token for a user.
func (*JWTManager) Verify ¶
func (manager *JWTManager) Verify(accessToken string) (*AgentTokenClaims, error)
Verify verifies the access token string and return a user claim if the token is valid.
type RPC ¶
type RPC struct {
// contains filtered or unexported fields
}
func (*RPC) Log ¶
Log writes a log entry to the database and publishes it to the pubsub. An explicit stepUUID makes it obvious that all entries must come from the same step.
func (*RPC) RegisterAgent ¶
func (*RPC) UnregisterAgent ¶
UnregisterAgent removes the agent from the database.
type StreamContextWrapper ¶
type StreamContextWrapper interface { grpc.ServerStream SetContext(context.Context) }
type WoodpeckerAuthServer ¶
type WoodpeckerAuthServer struct { proto.UnimplementedWoodpeckerAuthServer // contains filtered or unexported fields }
func NewWoodpeckerAuthServer ¶
func NewWoodpeckerAuthServer(jwtManager *JWTManager, agentMasterToken string, store store.Store) *WoodpeckerAuthServer
func (*WoodpeckerAuthServer) Auth ¶
func (s *WoodpeckerAuthServer) Auth(_ context.Context, req *proto.AuthRequest) (*proto.AuthResponse, error)
type WoodpeckerServer ¶
type WoodpeckerServer struct { proto.UnimplementedWoodpeckerServer // contains filtered or unexported fields }
WoodpeckerServer is a grpc server implementation.
func (*WoodpeckerServer) Done ¶
func (s *WoodpeckerServer) Done(c context.Context, req *proto.DoneRequest) (*proto.Empty, error)
func (*WoodpeckerServer) Extend ¶
func (s *WoodpeckerServer) Extend(c context.Context, req *proto.ExtendRequest) (*proto.Empty, error)
func (*WoodpeckerServer) Init ¶
func (s *WoodpeckerServer) Init(c context.Context, req *proto.InitRequest) (*proto.Empty, error)
func (*WoodpeckerServer) Log ¶
func (s *WoodpeckerServer) Log(c context.Context, req *proto.LogRequest) (*proto.Empty, error)
func (*WoodpeckerServer) Next ¶
func (s *WoodpeckerServer) Next(c context.Context, req *proto.NextRequest) (*proto.NextResponse, error)
func (*WoodpeckerServer) RegisterAgent ¶
func (s *WoodpeckerServer) RegisterAgent(c context.Context, req *proto.RegisterAgentRequest) (*proto.RegisterAgentResponse, error)
func (*WoodpeckerServer) ReportHealth ¶
func (s *WoodpeckerServer) ReportHealth(c context.Context, req *proto.ReportHealthRequest) (*proto.Empty, error)
func (*WoodpeckerServer) UnregisterAgent ¶
func (*WoodpeckerServer) Update ¶
func (s *WoodpeckerServer) Update(c context.Context, req *proto.UpdateRequest) (*proto.Empty, error)
func (*WoodpeckerServer) Version ¶
func (s *WoodpeckerServer) Version(_ context.Context, _ *proto.Empty) (*proto.VersionResponse, error)
func (*WoodpeckerServer) Wait ¶
func (s *WoodpeckerServer) Wait(c context.Context, req *proto.WaitRequest) (*proto.Empty, error)
Click to show internal directories.
Click to hide internal directories.