simple

package
v0.102.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Code generated by sysl DO NOT EDIT.

Code generated by sysl DO NOT EDIT.

Code generated by sysl DO NOT EDIT.

Code generated by sysl DO NOT EDIT.

Code generated by sysl DO NOT EDIT.

Code generated by sysl DO NOT EDIT.

Code generated by sysl DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var BusinessLogicError common.CustomError = map[string]string{"name": "BusinessLogicError", "http_code": "1001", "http_message": "foo", "http_status": "500"} // *BusinessLogicError2 error

*BusinessLogicError error

View Source
var BusinessLogicError2 common.CustomError = map[string]string{"name": "BusinessLogicError2", "http_code": "1002", "http_message": "foo2", "http_status": "501"}

Functions

func BuildRestHandlerInitialiser added in v0.19.0

func BuildRestHandlerInitialiser(serviceInterface ServiceInterface, callback core.RestGenCallback, downstream *DownstreamClients) handlerinitialiser.HandlerInitialiser

BuildRestHandlerInitialiser ...

func NewDefaultConfig added in v0.22.0

func NewDefaultConfig() config.DefaultConfig

NewDefaultConfig ...

func NewServiceRouter

NewServiceRouter creates a new service router for Simple

Types

type Callback

type Callback struct {
	// contains filtered or unexported fields
}

func (Callback) AddMiddleware

func (c Callback) AddMiddleware(ctx context.Context, r chi.Router)

func (Callback) BasePath

func (c Callback) BasePath() string

func (Callback) Config

func (c Callback) Config() interface{}

func (Callback) DownstreamTimeoutContext

func (c Callback) DownstreamTimeoutContext(ctx context.Context) (context.Context, context.CancelFunc)

func (Callback) MapError added in v0.5.0

func (c Callback) MapError(ctx context.Context, cause error) *common.HTTPError

type CallbackWithMapError added in v0.5.0

type CallbackWithMapError struct{}

type Cat added in v0.76.0

type Cat struct {
	Age   *int64 `json:"age,omitempty"`
	Hunts *bool  `json:"hunts,omitempty"`
	ID    string `json:"id"`
}

Cat ...

func (*Cat) Validate added in v0.76.0

func (s *Cat) Validate() error

*Cat validator

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for Simple API

func NewClient

func NewClient(client *http.Client, serviceURL string) *Client

NewClient for Simple

func (*Client) GetApiDocsList

func (s *Client) GetApiDocsList(ctx context.Context, req *GetApiDocsListRequest) (*[]deps.ApiDoc, error)

GetApiDocsList ...

func (*Client) GetGetSomeBytesList added in v0.12.0

func (s *Client) GetGetSomeBytesList(ctx context.Context, req *GetGetSomeBytesListRequest) (*Pdf, error)

GetGetSomeBytesList ...

func (*Client) GetJustOkAndJustErrorList

func (s *Client) GetJustOkAndJustErrorList(ctx context.Context, req *GetJustOkAndJustErrorListRequest) (*http.Header, error)

GetJustOkAndJustErrorList ...

func (*Client) GetJustReturnErrorList

func (s *Client) GetJustReturnErrorList(ctx context.Context, req *GetJustReturnErrorListRequest) error

GetJustReturnErrorList ...

func (*Client) GetJustReturnOkList

func (s *Client) GetJustReturnOkList(ctx context.Context, req *GetJustReturnOkListRequest) (*http.Header, error)

GetJustReturnOkList ...

func (*Client) GetOkTypeAndJustErrorList

func (s *Client) GetOkTypeAndJustErrorList(ctx context.Context, req *GetOkTypeAndJustErrorListRequest) (*Response, error)

GetOkTypeAndJustErrorList ...

func (*Client) GetOopsList

func (s *Client) GetOopsList(ctx context.Context, req *GetOopsListRequest) (*Response, error)

GetOopsList ...

func (*Client) GetPetaList added in v0.76.0

func (s *Client) GetPetaList(ctx context.Context, req *GetPetaListRequest) (*PetA, error)

GetPetaList ...

func (*Client) GetRawIdStatesList added in v0.29.0

func (s *Client) GetRawIdStatesList(ctx context.Context, req *GetRawIdStatesListRequest) (*Str, error)

GetRawIdStatesList ...

func (*Client) GetRawIntList

func (s *Client) GetRawIntList(ctx context.Context, req *GetRawIntListRequest) (*Integer, error)

GetRawIntList ...

func (*Client) GetRawList

func (s *Client) GetRawList(ctx context.Context, req *GetRawListRequest) (*Str, error)

GetRawList ...

func (*Client) GetRawStates2List added in v0.29.0

func (s *Client) GetRawStates2List(ctx context.Context, req *GetRawStates2ListRequest) (*Str, error)

GetRawStates2List ...

func (*Client) GetRawStatesList added in v0.29.0

func (s *Client) GetRawStatesList(ctx context.Context, req *GetRawStatesListRequest) (*[]Status, error)

GetRawStatesList ...

func (*Client) GetSimpleAPIDocsList added in v0.12.0

func (s *Client) GetSimpleAPIDocsList(ctx context.Context, req *GetSimpleAPIDocsListRequest) (*deps.ApiDoc, error)

GetSimpleAPIDocsList ...

func (*Client) GetStuffList

func (s *Client) GetStuffList(ctx context.Context, req *GetStuffListRequest) (*Stuff, error)

GetStuffList ...

func (*Client) PostStuff

func (s *Client) PostStuff(ctx context.Context, req *PostStuffRequest) (*Str, error)

PostStuff ...

type Config

type Config struct{}

func (Config) Validate

func (c Config) Validate() error

type DefaultSimpleImpl

type DefaultSimpleImpl struct {
}

DefaultSimpleImpl ...

func NewDefaultSimpleImpl

func NewDefaultSimpleImpl() *DefaultSimpleImpl

NewDefaultSimpleImpl for Simple

type Dog added in v0.76.0

type Dog struct {
	Bark  *bool   `json:"bark,omitempty"`
	Breed *string `json:"breed,omitempty"`
	ID    string  `json:"id"`
}

Dog ...

func (*Dog) Validate added in v0.76.0

func (s *Dog) Validate() error

*Dog validator

type DownstreamClients added in v0.19.0

type DownstreamClients struct {
	// contains filtered or unexported fields
}

DownstreamClients for Simple

func BuildDownstreamClients added in v0.19.0

func BuildDownstreamClients(cfg *config.DefaultConfig) (*DownstreamClients, error)

BuildDownstreamClients ...

type DownstreamConfig

type DownstreamConfig struct {
	ContextTimeout time.Duration               `yaml:"contextTimeout"`
	Deps           config.CommonDownstreamData `yaml:"deps"`
	Downstream     config.CommonDownstreamData `yaml:"downstream"`
}

DownstreamConfig for Simple

type Empty

type Empty struct {
}

Empty ...

type GetApiDocsListClient

type GetApiDocsListClient struct {
	GetApiDocsList     func(ctx context.Context, req *deps.GetApiDocsListRequest) (*deps.ApiDoc, error)
	GetServiceDocsList func(ctx context.Context, req *downstream.GetServiceDocsListRequest) (*[]downstream.ServiceDoc, error)
}

GetApiDocsList Client

type GetApiDocsListRequest

type GetApiDocsListRequest struct {
}

GetApiDocsListRequest ...

type GetGetSomeBytesListClient added in v0.9.0

type GetGetSomeBytesListClient struct {
}

GetGetSomeBytesList Client

type GetGetSomeBytesListRequest added in v0.9.0

type GetGetSomeBytesListRequest struct {
}

GetGetSomeBytesListRequest ...

type GetJustOkAndJustErrorListClient

type GetJustOkAndJustErrorListClient struct {
}

GetJustOkAndJustErrorList Client

type GetJustOkAndJustErrorListRequest

type GetJustOkAndJustErrorListRequest struct {
}

GetJustOkAndJustErrorListRequest ...

type GetJustReturnErrorListClient

type GetJustReturnErrorListClient struct {
}

GetJustReturnErrorList Client

type GetJustReturnErrorListRequest

type GetJustReturnErrorListRequest struct {
}

GetJustReturnErrorListRequest ...

type GetJustReturnOkListClient

type GetJustReturnOkListClient struct {
}

GetJustReturnOkList Client

type GetJustReturnOkListRequest

type GetJustReturnOkListRequest struct {
}

GetJustReturnOkListRequest ...

type GetOkTypeAndJustErrorListClient

type GetOkTypeAndJustErrorListClient struct {
}

GetOkTypeAndJustErrorList Client

type GetOkTypeAndJustErrorListRequest

type GetOkTypeAndJustErrorListRequest struct {
}

GetOkTypeAndJustErrorListRequest ...

type GetOopsListClient

type GetOopsListClient struct {
}

GetOopsList Client

type GetOopsListRequest

type GetOopsListRequest struct {
}

GetOopsListRequest ...

type GetPetaListClient added in v0.76.0

type GetPetaListClient struct {
}

GetPetaList Client

type GetPetaListRequest added in v0.76.0

type GetPetaListRequest struct {
	ID string
}

GetPetaListRequest ...

type GetRawIdStatesListClient added in v0.29.0

type GetRawIdStatesListClient struct {
}

GetRawIdStatesList Client

type GetRawIdStatesListRequest added in v0.29.0

type GetRawIdStatesListRequest struct {
	ID string
}

GetRawIdStatesListRequest ...

type GetRawIntListClient

type GetRawIntListClient struct {
}

GetRawIntList Client

type GetRawIntListRequest

type GetRawIntListRequest struct {
}

GetRawIntListRequest ...

type GetRawListClient

type GetRawListClient struct {
}

GetRawList Client

type GetRawListRequest

type GetRawListRequest struct {
	Bt bool
}

GetRawListRequest ...

type GetRawStates2ListClient added in v0.29.0

type GetRawStates2ListClient struct {
}

GetRawStates2List Client

type GetRawStates2ListRequest added in v0.29.0

type GetRawStates2ListRequest struct {
	ID int64
}

GetRawStates2ListRequest ...

type GetRawStatesListClient added in v0.29.0

type GetRawStatesListClient struct {
}

GetRawStatesList Client

type GetRawStatesListRequest added in v0.29.0

type GetRawStatesListRequest struct {
}

GetRawStatesListRequest ...

type GetSimpleAPIDocsListClient added in v0.2.0

type GetSimpleAPIDocsListClient struct {
	GetApiDocsList func(ctx context.Context, req *deps.GetApiDocsListRequest) (*deps.ApiDoc, error)
	GetSuccessList func(ctx context.Context, req *deps.GetSuccessListRequest) (*http.Header, error)
}

GetSimpleAPIDocsList Client

type GetSimpleAPIDocsListRequest added in v0.2.0

type GetSimpleAPIDocsListRequest struct {
}

GetSimpleAPIDocsListRequest ...

type GetStuffListClient

type GetStuffListClient struct {
}

GetStuffList Client

type GetStuffListRequest

type GetStuffListRequest struct {
	Dt *convert.JSONTime
	St *string
	Bt *bool
	It int64
}

GetStuffListRequest ...

type Handler

type Handler interface {
	GetApiDocsListHandler(w http.ResponseWriter, r *http.Request)
	GetGetSomeBytesListHandler(w http.ResponseWriter, r *http.Request)
	GetJustOkAndJustErrorListHandler(w http.ResponseWriter, r *http.Request)
	GetJustReturnErrorListHandler(w http.ResponseWriter, r *http.Request)
	GetJustReturnOkListHandler(w http.ResponseWriter, r *http.Request)
	GetOkTypeAndJustErrorListHandler(w http.ResponseWriter, r *http.Request)
	GetOopsListHandler(w http.ResponseWriter, r *http.Request)
	GetPetaListHandler(w http.ResponseWriter, r *http.Request)
	GetRawListHandler(w http.ResponseWriter, r *http.Request)
	GetRawIntListHandler(w http.ResponseWriter, r *http.Request)
	GetRawStatesListHandler(w http.ResponseWriter, r *http.Request)
	GetRawIdStatesListHandler(w http.ResponseWriter, r *http.Request)
	GetRawStates2ListHandler(w http.ResponseWriter, r *http.Request)
	GetSimpleAPIDocsListHandler(w http.ResponseWriter, r *http.Request)
	GetStuffListHandler(w http.ResponseWriter, r *http.Request)
	PostStuffHandler(w http.ResponseWriter, r *http.Request)
}

Handler interface for Simple

type Integer

type Integer int64

Integer ...

func GetRawIntList

func GetRawIntList(ctx context.Context, req *GetRawIntListRequest, client GetRawIntListClient) (*Integer, error)

type Item

type Item struct {
	A1   string `json:"A1"`
	A2   string `json:"A2"`
	Name string `json:"-"`
}

Item ...

func (*Item) Validate

func (s *Item) Validate() error

*Item validator

type ItemSet

type ItemSet struct {
	M map[string]Item
}

Generate wrapper set type

func (*ItemSet) Add

func (s *ItemSet) Add(item Item)

*Item add

func (*ItemSet) Lookup

func (s *ItemSet) Lookup(Name string) Item

*Item lookup

type Pdf added in v0.9.0

type Pdf []byte

Pdf ...

type PetA added in v0.76.0

type PetA interface {
	// contains filtered or unexported methods
}

PetA can be one of following types in runtime: Cat Dog

type PetB added in v0.76.0

type PetB interface {
	// contains filtered or unexported methods
}

PetB can be one of following types in runtime: Cat Dog

type PostRequest added in v0.52.0

type PostRequest struct {
	Bt *bool            `json:"Bt,omitempty"`
	Dt convert.JSONTime `json:"dt"`
	St string           `json:"St"`
}

PostRequest ...

func (*PostRequest) UnmarshalJSON added in v0.52.0

func (t *PostRequest) UnmarshalJSON(data []byte) error

func (*PostRequest) Validate added in v0.52.0

func (s *PostRequest) Validate() error

*PostRequest validator

type PostStuffClient

type PostStuffClient struct {
}

PostStuff Client

type PostStuffRequest

type PostStuffRequest struct {
	Request Str
}

PostStuffRequest ...

type Response

type Response struct {
	Data ItemSet `json:"Data"`
}

Response ...

func (*Response) Validate

func (s *Response) Validate() error

*Response validator

type Router

type Router interface {
	Route(router *chi.Mux)
}

Router interface for Simple

type Service

type Service interface {
	GetApiDocsList(ctx context.Context, req *GetApiDocsListRequest) (*[]deps.ApiDoc, error)
	GetGetSomeBytesList(ctx context.Context, req *GetGetSomeBytesListRequest) (*Pdf, error)
	GetJustOkAndJustErrorList(ctx context.Context, req *GetJustOkAndJustErrorListRequest) (*http.Header, error)
	GetJustReturnErrorList(ctx context.Context, req *GetJustReturnErrorListRequest) error
	GetJustReturnOkList(ctx context.Context, req *GetJustReturnOkListRequest) (*http.Header, error)
	GetOkTypeAndJustErrorList(ctx context.Context, req *GetOkTypeAndJustErrorListRequest) (*Response, error)
	GetOopsList(ctx context.Context, req *GetOopsListRequest) (*Response, error)
	GetPetaList(ctx context.Context, req *GetPetaListRequest) (*PetA, error)
	GetRawList(ctx context.Context, req *GetRawListRequest) (*Str, error)
	GetRawIntList(ctx context.Context, req *GetRawIntListRequest) (*Integer, error)
	GetRawStatesList(ctx context.Context, req *GetRawStatesListRequest) (*[]Status, error)
	GetRawIdStatesList(ctx context.Context, req *GetRawIdStatesListRequest) (*Str, error)
	GetRawStates2List(ctx context.Context, req *GetRawStates2ListRequest) (*Str, error)
	GetSimpleAPIDocsList(ctx context.Context, req *GetSimpleAPIDocsListRequest) (*deps.ApiDoc, error)
	GetStuffList(ctx context.Context, req *GetStuffListRequest) (*Stuff, error)
	PostStuff(ctx context.Context, req *PostStuffRequest) (*Str, error)
}

Service interface for Simple

type ServiceHandler

type ServiceHandler struct {
	// contains filtered or unexported fields
}

ServiceHandler for Simple API

func NewServiceHandler

func NewServiceHandler(genCallback core.RestGenCallback, serviceInterface *ServiceInterface, depsDepsService deps.Service, downstreamDownstreamService downstream.Service) *ServiceHandler

NewServiceHandler for Simple

func (*ServiceHandler) GetApiDocsListHandler

func (s *ServiceHandler) GetApiDocsListHandler(w http.ResponseWriter, r *http.Request)

GetApiDocsListHandler ...

func (*ServiceHandler) GetGetSomeBytesListHandler added in v0.9.0

func (s *ServiceHandler) GetGetSomeBytesListHandler(w http.ResponseWriter, r *http.Request)

GetGetSomeBytesListHandler ...

func (*ServiceHandler) GetJustOkAndJustErrorListHandler

func (s *ServiceHandler) GetJustOkAndJustErrorListHandler(w http.ResponseWriter, r *http.Request)

GetJustOkAndJustErrorListHandler ...

func (*ServiceHandler) GetJustReturnErrorListHandler

func (s *ServiceHandler) GetJustReturnErrorListHandler(w http.ResponseWriter, r *http.Request)

GetJustReturnErrorListHandler ...

func (*ServiceHandler) GetJustReturnOkListHandler

func (s *ServiceHandler) GetJustReturnOkListHandler(w http.ResponseWriter, r *http.Request)

GetJustReturnOkListHandler ...

func (*ServiceHandler) GetOkTypeAndJustErrorListHandler

func (s *ServiceHandler) GetOkTypeAndJustErrorListHandler(w http.ResponseWriter, r *http.Request)

GetOkTypeAndJustErrorListHandler ...

func (*ServiceHandler) GetOopsListHandler

func (s *ServiceHandler) GetOopsListHandler(w http.ResponseWriter, r *http.Request)

GetOopsListHandler ...

func (*ServiceHandler) GetPetaListHandler added in v0.76.0

func (s *ServiceHandler) GetPetaListHandler(w http.ResponseWriter, r *http.Request)

GetPetaListHandler ...

func (*ServiceHandler) GetRawIdStatesListHandler added in v0.29.0

func (s *ServiceHandler) GetRawIdStatesListHandler(w http.ResponseWriter, r *http.Request)

GetRawIdStatesListHandler ...

func (*ServiceHandler) GetRawIntListHandler

func (s *ServiceHandler) GetRawIntListHandler(w http.ResponseWriter, r *http.Request)

GetRawIntListHandler ...

func (*ServiceHandler) GetRawListHandler

func (s *ServiceHandler) GetRawListHandler(w http.ResponseWriter, r *http.Request)

GetRawListHandler ...

func (*ServiceHandler) GetRawStates2ListHandler added in v0.29.0

func (s *ServiceHandler) GetRawStates2ListHandler(w http.ResponseWriter, r *http.Request)

GetRawStates2ListHandler ...

func (*ServiceHandler) GetRawStatesListHandler added in v0.29.0

func (s *ServiceHandler) GetRawStatesListHandler(w http.ResponseWriter, r *http.Request)

GetRawStatesListHandler ...

func (*ServiceHandler) GetSimpleAPIDocsListHandler added in v0.4.0

func (s *ServiceHandler) GetSimpleAPIDocsListHandler(w http.ResponseWriter, r *http.Request)

GetSimpleAPIDocsListHandler ...

func (*ServiceHandler) GetStuffListHandler

func (s *ServiceHandler) GetStuffListHandler(w http.ResponseWriter, r *http.Request)

GetStuffListHandler ...

func (*ServiceHandler) PostStuffHandler

func (s *ServiceHandler) PostStuffHandler(w http.ResponseWriter, r *http.Request)

PostStuffHandler ...

type ServiceInterface

type ServiceInterface struct {
	GetApiDocsList            func(ctx context.Context, req *GetApiDocsListRequest, client GetApiDocsListClient) (*[]deps.ApiDoc, error)
	GetGetSomeBytesList       func(ctx context.Context, req *GetGetSomeBytesListRequest, client GetGetSomeBytesListClient) (*Pdf, error)
	GetJustOkAndJustErrorList func(ctx context.Context, req *GetJustOkAndJustErrorListRequest, client GetJustOkAndJustErrorListClient) error
	GetJustReturnErrorList    func(ctx context.Context, req *GetJustReturnErrorListRequest, client GetJustReturnErrorListClient) error
	GetJustReturnOkList       func(ctx context.Context, req *GetJustReturnOkListRequest, client GetJustReturnOkListClient) error
	GetOkTypeAndJustErrorList func(ctx context.Context, req *GetOkTypeAndJustErrorListRequest, client GetOkTypeAndJustErrorListClient) (*Response, error)
	GetOopsList               func(ctx context.Context, req *GetOopsListRequest, client GetOopsListClient) (*Response, error)
	GetPetaList               func(ctx context.Context, req *GetPetaListRequest, client GetPetaListClient) (*PetA, error)
	GetRawList                func(ctx context.Context, req *GetRawListRequest, client GetRawListClient) (*Str, error)
	GetRawIntList             func(ctx context.Context, req *GetRawIntListRequest, client GetRawIntListClient) (*Integer, error)
	GetRawStatesList          func(ctx context.Context, req *GetRawStatesListRequest, client GetRawStatesListClient) (*[]Status, error)
	GetRawIdStatesList        func(ctx context.Context, req *GetRawIdStatesListRequest, client GetRawIdStatesListClient) (*Str, error)
	GetRawStates2List         func(ctx context.Context, req *GetRawStates2ListRequest, client GetRawStates2ListClient) (*Str, error)
	GetSimpleAPIDocsList      func(ctx context.Context, req *GetSimpleAPIDocsListRequest, client GetSimpleAPIDocsListClient) (*deps.ApiDoc, error)
	GetStuffList              func(ctx context.Context, req *GetStuffListRequest, client GetStuffListClient) (*Stuff, error)
	PostStuff                 func(ctx context.Context, req *PostStuffRequest, client PostStuffClient) (*Str, error)
}

ServiceInterface for Simple

type ServiceRouter

type ServiceRouter struct {
	// contains filtered or unexported fields
}

ServiceRouter for Simple API

func (*ServiceRouter) Config

func (s *ServiceRouter) Config() interface{}

Config ...

func (*ServiceRouter) Name

func (s *ServiceRouter) Name() string

Name ...

func (*ServiceRouter) WireRoutes

func (s *ServiceRouter) WireRoutes(ctx context.Context, r chi.Router)

WireRoutes ...

type Status

type Status struct {
	StatusField string `json:"statusField"`
}

Status ...

func (Status) Error

func (s Status) Error() string

Error fulfills the error type interface for Status

func (*Status) Validate

func (s *Status) Validate() error

*Status validator

type Str

type Str string

Str ...

func GetRawIdStatesList added in v0.29.0

func GetRawIdStatesList(ctx context.Context, req *GetRawIdStatesListRequest, client GetRawIdStatesListClient) (*Str, error)

func GetRawList

func GetRawList(ctx context.Context, req *GetRawListRequest, client GetRawListClient) (*Str, error)

type Stuff

type Stuff struct {
	EmptyStuff     Empty                  `json:"emptyStuff"`
	InnerStuff     string                 `json:"innerStuff"`
	RawTimeStuff   time.Time              `json:"rawTimeStuff"`
	ResponseStuff  Response               `json:"responseStuff"`
	SensitiveStuff common.SensitiveString `json:"sensitiveStuff"`
	SequenceStuff  []Str                  `json:"sequenceStuff,omitempty"`
	TimeStuff      convert.JSONTime       `json:"timeStuff"`
}

func GetStuffList

func GetStuffList(ctx context.Context, req *GetStuffListRequest, client GetStuffListClient) (*Stuff, error)

func (*Stuff) Validate

func (s *Stuff) Validate() error

*Stuff validator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL