Documentation ¶
Index ¶
- Constants
- Variables
- func GetClientSessionClaims(ctx context.Context, header http.Header) (string, *model.ClusterClientSessionClaim, error)
- func Header(md metadata.MD) http.Header
- func KeepAliveClientSessionStatus(ctx context.Context, claimsToken string, ...)
- func NewNullString(s string) sql.NullString
- func NewNullTime(t *timestamppb.Timestamp) sql.NullTime
- func PollServiceFilter(limit int, exp time.Time, now time.Time) func(*model.ClusterService) bool
- type AccessTokenResponse
- type Auth
- type Echo
- type GRPC
- func (*GRPC) AuthV1(ctx context.Context, auth *client.AuthRequestV1) (*client.AuthResponseV1, error)
- func (*GRPC) ServicePollingV1(ctx context.Context, in *client.ServicePollingRequestV1) (*client.ServicePollingResponseV1, error)
- func (*GRPC) UpdateServiceStatusV1(ctx context.Context, serviceStatus *client.UpdateServiceStatusRequestV1) (*client.UpdateServiceStatusResponseV1, error)
- type Map
- type Object
- type ServiceResponse
- type ServiceStatus
Constants ¶
const (
HTTP_HEADER_X_OLD_CLIENT_TOKEN = "x-sudory-client-token"
)
Variables ¶
var ErrorInvalidIncomingContext = fmt.Errorf("invalid incoming context")
var ErrorInvalidToken = fmt.Errorf("invalid token")
Functions ¶
func GetClientSessionClaims ¶
func NewNullString ¶
func NewNullString(s string) sql.NullString
func NewNullTime ¶
func NewNullTime(t *timestamppb.Timestamp) sql.NullTime
func PollServiceFilter ¶
Types ¶
type AccessTokenResponse ¶
type AccessTokenResponse struct { TokenType string `json:"token_type" enum:"Basic,Bearer"` // (required) AccessToken string `json:"access_token"` // (required) ExpiresIn int64 `json:"expires_in,omitempty"` // (recommended) RefreshToken string `json:"refresh_token,omitempty"` // (optional) Scope string `json:"scope,omitempty"` // (optional) }
type Echo ¶
type Echo struct{}
func (Echo) Auth ¶
@Description auth client @Accept json @Produce json @Tags /api/v1/client @Router /api/v1/client/auth [post] @Param body body Auth true "Auth" @Success 200 {string} ok @Header 200 {string} x-sudory-client-token @Header 200 {object} AccessTokenResponse
func (Echo) PollService ¶
@Description get []Service @Security ClientAuthorization @Accept json @Produce json @Tags /api/v1/client @Router /api/v1/client/service [get] @param limit query int false "count limit of ServiceResponse"" @Success 200 {array} ServiceResponse
func (Echo) UpdateService ¶
@Description update a service status @Security ClientAuthorization @Accept json @Produce json @Tags /api/v1/client @Router /api/v1/client/service [put] @Param body body ServiceStatus true "ServiceStatus" @Success 200
type GRPC ¶
type GRPC struct {
client.UnimplementedClientServiceServer
}
func (*GRPC) AuthV1 ¶
func (*GRPC) AuthV1(ctx context.Context, auth *client.AuthRequestV1) (*client.AuthResponseV1, error)
AuthV1 implements client.ClientServiceServer
func (*GRPC) ServicePollingV1 ¶
func (*GRPC) ServicePollingV1(ctx context.Context, in *client.ServicePollingRequestV1) (*client.ServicePollingResponseV1, error)
ServicePollingV1 implements client.ClientServiceServer
func (*GRPC) UpdateServiceStatusV1 ¶
func (*GRPC) UpdateServiceStatusV1(ctx context.Context, serviceStatus *client.UpdateServiceStatusRequestV1) (*client.UpdateServiceStatusResponseV1, error)
UpdateServiceStatusV1 implements client.ClientServiceServer
type ServiceResponse ¶
type ServiceResponse struct { ClusterUUID string `json:"cluster_uuid"` UUID string `json:"uuid"` Name string `json:"name"` Summary *string `json:"summary,omitempty"` TemplateUUID string `json:"template_uuid"` Flow string `json:"flow"` Inputs Object `json:"inputs" swaggertype:"object"` StepMax int `json:"step_max"` SubscribedChannel *string `json:"subscribed_channel,omitempty"` Priority model.Priority `json:"priority"` Created time.Time `json:"created"` }
func NewServiceResponse ¶
func NewServiceResponse(service model.ClusterService) ServiceResponse